DomUtil

Dom Utils some code reference leaflet https://github.com/Leaflet/Leaflet/tree/master/src/core

new TS.DomUtil()

Methods

static TS.DomUtil.addClass(el, name)

Adds `name` to the element's class attribute.
Name Type Description
el *
name *

static TS.DomUtil.create(tagName, className, container)HTMLElement

Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.
Name Type Default Description
tagName
className
container null
Returns:

static TS.DomUtil.createSvg(width, height, path, container)SVGElement

Creates svg
Name Type Description
width
height
path
container
Returns:

static TS.DomUtil.empty(el)

Removes all of `el`'s children elements from `el`
Name Type Description
el *

static TS.DomUtil.enterFullscreen(el)

enter full screen
Name Type Description
el

static TS.DomUtil.exitFullscreen()

exit full screen

static TS.DomUtil.get(id)HTMLElement|*

Returns an element given its DOM id, or returns the element itself if it was passed directly.
Name Type Description
id
Returns:

static TS.DomUtil.getClass(el)

Returns the element's class.
Name Type Description
el *

static TS.DomUtil.getStyle(el, style)null|*

Returns the value for a certain style attribute on an element, including computed values or values set through CSS.
Name Type Description
el
style
Returns:

static TS.DomUtil.hasClass(el, name)

Returns `true` if the element's class attribute contains `name`.
Name Type Description
el *
name *

static TS.DomUtil.parseDom(domStr, withWrapper, className)HTMLDivElement|NodeListOf.<ChildNode>

Parses string to Dom
Name Type Description
domStr
withWrapper
className
Returns:

static TS.DomUtil.remove(el)

Removes `el` from its parent element
Name Type Description
el *

static TS.DomUtil.removeClass(el, name)

Removes `name` from the element's class attribute.
Name Type Description
el *
name *

static TS.DomUtil.setClass(el, name)

Sets the element's class.
Name Type Description
el *
name *