Report an issue
Class

CKEDITOR.plugins.lineutils.liner

class private

A utility that draws horizontal lines in DOM according to locations returned by CKEDITOR.plugins.lineutils.locator.

Filtering

Methods

  • since 4.3.0

    constructor( editor, def ) → liner

    Creates a Liner class instance.

    Parameters

    editor : editor

    Editor instance that Liner belongs to.

    def : Object

    Liner's definition.

    Returns

    liner
  • addLine() → element

    Adds a new line to DOM.

    Returns

    element

    A brand-new line.

  • cleanup()

    Hides all visible lines that do not belong to current hash and no longer represent relations (locations).

    See also: prepare.

  • getClientRect( el ) → Object

    Returns boundingClientRect of an element, shifted by the position of container when the container is not static (https://dev.ckeditor.com/ticket/13155).

    See also: CKEDITOR.dom.element.getClientRect.

    Parameters

    el : element

    A DOM element.

    Returns

    Object

    A shifted rect, extended by relativeY and relativeX properties.

  • getStyle( uid, type ) → Object

    Creates a style set to be used by the line, representing a particular relation (location).

    Parameters

    uid : Number

    Unique identifier of the relation.

    type : Number

    Type of the relation.

    Returns

    Object

    An object containing styles.

  • hideLine( line )

    Hides a given line.

    Parameters

    line : element

    The line to be hidden.

  • hideVisible()

    Hides all visible lines.

  • placeLine( location, [ callback ] )

    Shows a line at given location.

    Parameters

    location : Object

    Location object containing the unique identifier of the relation and its type. Usually returned by CKEDITOR.plugins.lineutils.locator.sort.

    [ callback ] : Function

    A callback to be called once the line is shown.

  • prepare( relations, locations )

    Assigns a unique hash to the instance that is later used to tell unwanted lines from new ones. This method must be called before a new set of relations is to be visualized so cleanup eventually hides obsolete lines. This is because lines are re-used between placeLine calls and the number of necessary ones may vary depending on the number of relations.

    Parameters

    relations : Object

    CKEDITOR.plugins.lineutils.finder.relations.

    locations : Object

    CKEDITOR.plugins.lineutils.locator.locations.

  • queryViewport()

    Queries dimensions of the viewport, editable, frame etc. that are used for correct positioning of the line.

  • removeAll()

    Permanently removes all lines (both hidden and visible) from DOM.

  • showLine( line )

    Shows a given line.

    Parameters

    line : element

    The line to be shown.