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 : editorEditor instance that Liner belongs to.
def : ObjectLiner's definition.
Returns
liner
-
addLine() → elementCKEDITOR.plugins.lineutils.liner#addLine -
cleanup()CKEDITOR.plugins.lineutils.liner#cleanupHides all visible lines that do not belong to current hash and no longer represent relations (locations).
See also: prepare.
-
getClientRect( el ) → ObjectCKEDITOR.plugins.lineutils.liner#getClientRectReturns
boundingClientRectof an element, shifted by the position ofcontainerwhen the container is notstatic(https://dev.ckeditor.com/ticket/13155).See also: CKEDITOR.dom.element.getClientRect.
Parameters
el : elementA DOM element.
Returns
ObjectA shifted rect, extended by
relativeYandrelativeXproperties.
-
getStyle( uid, type ) → ObjectCKEDITOR.plugins.lineutils.liner#getStyleCreates a style set to be used by the line, representing a particular relation (location).
Parameters
uid : NumberUnique identifier of the relation.
type : NumberType of the relation.
Returns
ObjectAn object containing styles.
-
hideLine( line )CKEDITOR.plugins.lineutils.liner#hideLine -
hideVisible()CKEDITOR.plugins.lineutils.liner#hideVisibleHides all visible lines.
-
placeLine( location, [ callback ] )CKEDITOR.plugins.lineutils.liner#placeLineShows a line at given location.
Parameters
location : ObjectLocation object containing the unique identifier of the relation and its type. Usually returned by CKEDITOR.plugins.lineutils.locator.sort.
[ callback ] : FunctionA callback to be called once the line is shown.
-
prepare( relations, locations )CKEDITOR.plugins.lineutils.liner#prepareAssigns 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 : Objectlocations : Object
-
queryViewport()CKEDITOR.plugins.lineutils.liner#queryViewportQueries dimensions of the viewport, editable, frame etc. that are used for correct positioning of the line.
-
removeAll()CKEDITOR.plugins.lineutils.liner#removeAllPermanently removes all lines (both hidden and visible) from DOM.
-
showLine( line )CKEDITOR.plugins.lineutils.liner#showLine