Editor.UI (DOM Utils Module)
Methods
Editor.UI.createStyleElement (url)
- urlstring
Load url content and create a style element to wrap it.
Editor.UI.clear (element)
- elementHTMLElement
Remove all child element.
Editor.UI.index (element)
- elementHTMLElement
Get the index of the element
Editor.UI.parentElement (element)
- elementHTMLElement
Get the parent element, it will go through the host if it is a shadow element.
Editor.UI.offsetTo (el, parentEL)
- elHTMLElement
- parentELHTMLElement
Returns the offset {x, y} from el to parentEL
Editor.UI.walk (el, [opts,] cb)
- elHTMLElement
- optsobject- diveToShadowboolean
- excludeSelfboolean
 
- cbfunction
Recursively search children use depth first algorithm.
Editor.UI.fire (element, eventName, opts)
- elementHTMLElement
- eventNamestring
- optsobject
Fires a CustomEvent to the specific element. Example:
Editor.fire(el, 'foobar', {
  bubbles: false,
  detail: {
    value: 'Hello World!'
  }
});
Editor.UI.acceptEvent (event)
- eventEvent
Call preventDefault and stopImmediatePropagation for the event
Editor.UI.installDownUpEvent (element)
- elementHTMLElement
Handle mouse down and up event for button like element
Editor.UI.inDocument (el)
- elHTMLElement
Check if the element is in document
Editor.UI.inPanel (el)
- elHTMLElement
Check if the element is in panel
Editor.UI.isVisible (el)
- elHTMLElement
Check if the element is visible by itself
Editor.UI.isVisibleInHierarchy (el)
- elHTMLElement
Check if the element is visible in hierarchy
Editor.UI.startDrag (cursor, event, onMove, onEnd, onWheel)
- cursorstring - CSS cursor
- eventEvent
- onMovefunction
- onEndfunction
- onWheelfunction
Start handling element dragging behavior
Editor.UI.cancelDrag ()
Cancel dragging element
Editor.UI.addDragGhost (cursor)
- cursorstring - CSS cursor
Add a dragging mask to keep the cursor not changed while dragging
Editor.UI.removeDragGhost ()
Remove the dragging mask
Editor.UI.addHitGhost (cursor, zindex, onhit)
- cursorstring - CSS cursor
- zindexnumber
- onhitfunction
Add hit mask
Editor.UI.removeHitGhost ()
Remove hit mask
Editor.UI.addLoadingMask (options, onclick)
- optionsobject
- onclickfunction
Add loading mask
Editor.UI.removeLoadingMask ()
Remove loading mask
Editor.UI.toHumanText (text)
- textstring
Convert a string to human friendly text. For example, fooBar will be Foo bar
Editor.UI.camelCase (text)
- textstring
Convert a string to camel case text. For example, foo-bar will be fooBar
Editor.UI.kebabCase (text)
- textstring
Convert a string to kebab case text. For example, fooBar will be foo-bar
