Position (utils/dom)
@ckeditor/ckeditor5-utils/src/dom/position
A position class which instances are created and used by the getOptimalPosition
helper.
top
and left
properties of the position instance
translate directly to the top
and left
properties in CSS "position: absolute
coordinate system". If set on the positioned element
in DOM, they will make it display it in the right place in the viewport.
Filtering
Properties
-
config : Object
module:utils/dom/position~Position#config
readonly
Additional position configuration, as passed from the positioning function.
This object can be use, for instance, to pass through presentation options used by the consumer of the
getOptimalPosition
helper. -
left : Number
module:utils/dom/position~Position#left
readonly
The left value in pixels in the CSS
position: absolute
coordinate system. Set it on the positioned element in DOM to move it to the position. -
name : String
module:utils/dom/position~Position#name
readonly
Position name.
-
top : Number
module:utils/dom/position~Position#top
readonly
The top value in pixels in the CSS
position: absolute
coordinate system. Set it on the positioned element in DOM to move it to the position. -
_absoluteRect : Rect
module:utils/dom/position~Position#_absoluteRect
private
An already absolutely positioned element rect. See (
_rect
). -
_limiterIntersectionArea : Number
module:utils/dom/position~Position#_limiterIntersectionArea
private readonly
An intersection area between positioned element and limiter within viewport constraints.
-
An already positioned element rect. A clone of the element rect passed to the constructor but placed in the viewport according to the positioning function.
-
_viewportIntersectionArea : Number
module:utils/dom/position~Position#_viewportIntersectionArea
private readonly
An intersection area between positioned element and viewport.
Methods
-
constructor( [ positioningFunction ], [ options ] = { options.elementRect, options.targetRect, options.viewportRect, [options.positionedElementAncestor] } )
module:utils/dom/position~Position#constructor
Creates an instance of the
Position
class.Parameters
[ positioningFunction ] : positioningFunction
function The function that defines the expected coordinates the positioned element should move to.
[ options ] : Object
options object.
Properties
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.