CKEDITOR.plugins.lineutils.liner
A utility that draws horizontal lines in DOM according to locations returned by CKEDITOR.plugins.lineutils.locator.
Filtering
Methods
-
constructor( editor, def ) → liner
since 4.3.0
Creates a Liner class instance.
-
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 ofcontainer
when the container is notstatic
(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
andrelativeX
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.
-
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
locations : Object
-
Queries dimensions of the viewport, editable, frame etc. that are used for correct positioning of the line.
-
Permanently removes all lines (both hidden and visible) from DOM.
-
showLine( line )
Shows a given line.
Parameters
line : element
The line to be shown.