CKEDITOR.plugins.lineutils.liner
A utility that draws horizontal lines in DOM according to locations returned by CKEDITOR.plugins.lineutils.locator.
Filtering
Methods
-
Creates a Liner class instance.
Parameters
editor : editor
Editor instance that Liner belongs to.
def : Object
Liner's definition.
Returns
liner
-
addLine() → element
CKEDITOR.plugins.lineutils.liner#addLine
-
cleanup()
CKEDITOR.plugins.lineutils.liner#cleanup
Hides all visible lines that do not belong to current hash and no longer represent relations (locations).
See also: prepare.
-
getClientRect( el ) → Object
CKEDITOR.plugins.lineutils.liner#getClientRect
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
CKEDITOR.plugins.lineutils.liner#getStyle
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 )
CKEDITOR.plugins.lineutils.liner#hideLine
-
hideVisible()
CKEDITOR.plugins.lineutils.liner#hideVisible
Hides all visible lines.
-
placeLine( location, [ callback ] )
CKEDITOR.plugins.lineutils.liner#placeLine
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 )
CKEDITOR.plugins.lineutils.liner#prepare
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
-
queryViewport()
CKEDITOR.plugins.lineutils.liner#queryViewport
Queries dimensions of the viewport, editable, frame etc. that are used for correct positioning of the line.
-
removeAll()
CKEDITOR.plugins.lineutils.liner#removeAll
Permanently removes all lines (both hidden and visible) from DOM.
-
showLine( line )
CKEDITOR.plugins.lineutils.liner#showLine