widget/widgettypearound/utils
@ckeditor/ckeditor5-widget/src/widgettypearound/utils
Filtering
Constants
-
TYPE_AROUND_SELECTION_ATTRIBUTE : 'widget-type-around'
module:widget/widgettypearound/utils#TYPE_AROUND_SELECTION_ATTRIBUTE
The name of the type around model selection attribute responsible for displaying a fake caret next to a selected widget.
Functions
-
getClosestTypeAroundDomButton( domElement ) → HTMLElement | null
module:widget/widgettypearound/utils~getClosestTypeAroundDomButton
For the passed HTML element, this helper finds the closest widget type around button ancestor.
Parameters
domElement : HTMLElement
Returns
HTMLElement | null
-
getClosestWidgetViewElement( domElement, domConverter ) → Element
module:widget/widgettypearound/utils~getClosestWidgetViewElement
For the passed HTML element, this helper returns the closest view widget ancestor.
Parameters
domElement : HTMLElement
domConverter : DomConverter
Returns
-
getTypeAroundButtonPosition( domElement ) → 'before' | 'after'
module:widget/widgettypearound/utils~getTypeAroundButtonPosition
For the passed widget type around button element, this helper determines at which position the paragraph would be inserted into the content if, for instance, the button was clicked by the user.
Parameters
domElement : HTMLElement
Returns
'before' | 'after'
The position of the button.
-
getTypeAroundFakeCaretPosition( selection ) → 'before' | 'after' | null
module:widget/widgettypearound/utils~getTypeAroundFakeCaretPosition
For the passed selection instance, it returns the position of the fake caret displayed next to a widget.
Note: If the fake caret is not currently displayed,
null
is returned.Parameters
selection : Selection | DocumentSelection
Returns
'before' | 'after' | null
The position of the fake caret or
null
when none is present.
-
isTypeAroundWidget( viewElement, modelElement, schema ) → boolean
module:widget/widgettypearound/utils~isTypeAroundWidget
Checks if an element is a widget that qualifies to get the widget type around UI.
Parameters
Returns
boolean
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.