- Editor.UI (DOM Utils Module)
- Methods
- Editor.UI.createStyleElement (url)
- Editor.UI.clear (element)
- Editor.UI.index (element)
- Editor.UI.parentElement (element)
- Editor.UI.offsetTo (el, parentEL)
- Editor.UI.walk (el, [opts,] cb)
- Editor.UI.fire (element, eventName, opts)
- Editor.UI.acceptEvent (event)
- Editor.UI.installDownUpEvent (element)
- Editor.UI.inDocument (el)
- Editor.UI.inPanel (el)
- Editor.UI.isVisible (el)
- Editor.UI.isVisibleInHierarchy (el)
- Editor.UI.startDrag (cursor, event, onMove, onEnd, onWheel)
- Editor.UI.cancelDrag ()
- Editor.UI.addDragGhost (cursor)
- Editor.UI.removeDragGhost ()
- Editor.UI.addHitGhost (cursor, zindex, onhit)
- Editor.UI.removeHitGhost ()
- Editor.UI.addLoadingMask (options, onclick)
- Editor.UI.removeLoadingMask ()
- Editor.UI.toHumanText (text)
- Editor.UI.camelCase (text)
- Editor.UI.kebabCase (text)
- Methods
Editor.UI (DOM Utils Module)
Methods
Editor.UI.createStyleElement (url)
url
string
Loadurl
content and create a style element to wrap it.
Editor.UI.clear (element)
element
HTMLElement
Remove all child element.
Editor.UI.index (element)
element
HTMLElement
Get the index of theelement
Editor.UI.parentElement (element)
element
HTMLElement
Get the parent element, it will go through the host if it is a shadow element.
Editor.UI.offsetTo (el, parentEL)
el
HTMLElementparentEL
HTMLElement
Returns the offset{x, y}
fromel
toparentEL
Editor.UI.walk (el, [opts,] cb)
el
HTMLElementopts
objectdiveToShadow
booleanexcludeSelf
boolean
cb
function
Recursively search children use depth first algorithm.
Editor.UI.fire (element, eventName, opts)
element
HTMLElementeventName
stringopts
object
Fires a CustomEvent to the specific element. Example:
Editor.fire(el, 'foobar', {
bubbles: false,
detail: {
value: 'Hello World!'
}
});
Editor.UI.acceptEvent (event)
event
Event
Call preventDefault and stopImmediatePropagation for the event
Editor.UI.installDownUpEvent (element)
element
HTMLElement
Handle mouse down and up event for button like element
Editor.UI.inDocument (el)
el
HTMLElement
Check if the element is in document
Editor.UI.inPanel (el)
el
HTMLElement
Check if the element is in panel
Editor.UI.isVisible (el)
el
HTMLElement
Check if the element is visible by itself
Editor.UI.isVisibleInHierarchy (el)
el
HTMLElement
Check if the element is visible in hierarchy
Editor.UI.startDrag (cursor, event, onMove, onEnd, onWheel)
cursor
string - CSS cursorevent
EventonMove
functiononEnd
functiononWheel
function
Start handling element dragging behavior
Editor.UI.cancelDrag ()
Cancel dragging element
Editor.UI.addDragGhost (cursor)
cursor
string - 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)
cursor
string - CSS cursorzindex
numberonhit
function
Add hit mask
Editor.UI.removeHitGhost ()
Remove hit mask
Editor.UI.addLoadingMask (options, onclick)
options
objectonclick
function
Add loading mask
Editor.UI.removeLoadingMask ()
Remove loading mask
Editor.UI.toHumanText (text)
text
string
Convert a string to human friendly text. For example,fooBar
will beFoo bar
Editor.UI.camelCase (text)
text
string
Convert a string to camel case text. For example,foo-bar
will befooBar
Editor.UI.kebabCase (text)
text
string
Convert a string to kebab case text. For example,fooBar
will befoo-bar