Class

StickyPanelView (ui/panel/sticky)

@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview

class

The sticky panel view class.

Filtering

Properties

  • readonly

    content : ViewCollection

    Collection of the child views which creates balloon panel contents.

  • readonly observable

    isActive : Boolean

    Controls whether the sticky panel should be active.

  • readonly observable

    isSticky : Boolean

    Controls whether the sticky panel is in the "sticky" state.

  • readonly observable

    limiterBottomOffset : Number

    The offset from the bottom edge of limiterElement which stops the panel from stickying any further to prevent limiter's content from being completely covered.

    Defaults to 50

  • readonly observable

    limiterElement : HTMLElement

    The limiter element for the sticky panel instance. Its bounding rect limits the "stickyness" of the panel, i.e. when the panel reaches the bottom edge of the limiter, it becomes sticky to that edge and does not float off the limiter. It is mandatory for the panel to work properly and once set, it cannot be changed.

  • observable

    viewportTopOffset : Number

    The offset from the top edge of the web browser's viewport which makes the panel become sticky. The default value is 0, which means the panel becomes sticky when it's upper edge touches the top of the page viewport.

    This attribute is useful when the web page has UI elements positioned to the top either using position: fixed or position: sticky, which would cover the sticky panel or vice–versa (depending on the z-index hierarchy).

    Bound to EditorUI#viewportOffset.

    If EditorConfig#ui.viewportOffset.top is defined, then it will override the default value.

    Defaults to 0

  • protected

    _contentPanel

    The panel which accepts children into content collection. Also an element which is positioned when isSticky.

  • protected

    _contentPanelPlaceholder

    A dummy element which visually fills the space as long as the actual panel is sticky. It prevents flickering of the UI.

  • protected readonly observable

    _hasViewportTopOffset : Boolean

    Set true if the sticky panel uses the viewportTopOffset, i.e. not _isStickyToTheLimiter and the viewportTopOffset is not 0.

  • protected readonly observable

    _isStickyToTheLimiter : Boolean

    Set true if the sticky panel reached the bottom edge of the limiterElement.

  • protected

    _limiterRect : Object

    The DOM bounding client rect of the limiterElement of the panel.

  • protected readonly observable

    _marginLeft : String

    Controls the margin-left CSS style of the panel.

  • protected

    _panelRect : Object

    The DOM bounding client rect of the element of the panel.

Methods

  • constructor()

  • protected

    _checkIfShouldBeSticky()

    Analyzes the environment to decide whether the panel should be sticky or not.

Events

  • protected

    change:_hasViewportTopOffset( eventInfo, name, value, oldValue )

    Fired when the _hasViewportTopOffset property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (_hasViewportTopOffset).

    value : Boolean

    New value of the _hasViewportTopOffset property with given key or null, if operation should remove property.

    oldValue : Boolean

    Old value of the _hasViewportTopOffset property with given key or null, if property was not set before.

  • protected

    change:_isStickyToTheLimiter( eventInfo, name, value, oldValue )

    Fired when the _isStickyToTheLimiter property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (_isStickyToTheLimiter).

    value : Boolean

    New value of the _isStickyToTheLimiter property with given key or null, if operation should remove property.

    oldValue : Boolean

    Old value of the _isStickyToTheLimiter property with given key or null, if property was not set before.

  • protected

    change:_marginLeft( eventInfo, name, value, oldValue )

    Fired when the _marginLeft property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (_marginLeft).

    value : String

    New value of the _marginLeft property with given key or null, if operation should remove property.

    oldValue : String

    Old value of the _marginLeft property with given key or null, if property was not set before.

  • change:isActive( eventInfo, name, value, oldValue )

    Fired when the isActive property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (isActive).

    value : Boolean

    New value of the isActive property with given key or null, if operation should remove property.

    oldValue : Boolean

    Old value of the isActive property with given key or null, if property was not set before.

  • change:isSticky( eventInfo, name, value, oldValue )

    Fired when the isSticky property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (isSticky).

    value : Boolean

    New value of the isSticky property with given key or null, if operation should remove property.

    oldValue : Boolean

    Old value of the isSticky property with given key or null, if property was not set before.

  • change:limiterBottomOffset( eventInfo, name, value, oldValue )

    Fired when the limiterBottomOffset property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (limiterBottomOffset).

    value : Number

    New value of the limiterBottomOffset property with given key or null, if operation should remove property.

    oldValue : Number

    Old value of the limiterBottomOffset property with given key or null, if property was not set before.

  • change:limiterElement( eventInfo, name, value, oldValue )

    Fired when the limiterElement property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (limiterElement).

    value : HTMLElement

    New value of the limiterElement property with given key or null, if operation should remove property.

    oldValue : HTMLElement

    Old value of the limiterElement property with given key or null, if property was not set before.

  • change:viewportTopOffset( eventInfo, name, value, oldValue )

    Fired when the viewportTopOffset property changed value.

    Parameters

    eventInfo : EventInfo

    An object containing information about the fired event.

    name : String

    Name of the changed property (viewportTopOffset).

    value : Number

    New value of the viewportTopOffset property with given key or null, if operation should remove property.

    oldValue : Number

    Old value of the viewportTopOffset property with given key or null, if property was not set before.