Expand all

abstract ve.dm.ClassAttributeNode

Constructor

new ve.dm.ClassAttributeNode()abstract #

DataModel class-attribute node.

Used for nodes which use classes to store attributes.

Source:
DataModel class-attribute node.

Properties

classAttributes :Objectstatic #

Mapping from class names to attributes

e.g. { alignLeft: { align: 'left' } } sets the align attribute to 'left' if the element has the class 'alignLeft'

Type:

Source:

Mapping from class names to attributes

e.g.

Methods

getClassAttrFromAttributes(attributes) → {string|null}static #

Get class attribute from element attributes

Parameters:

Name Type Description
attributes Object | undefined

Element attributes

Source:

Returns:

Class name, or null if no classes to set

Type
string | null
Get class attribute from element attributes

sanitize()static #

setClassAttributes(attributes, classAttr)static #

Set attributes from a class attribute

Unrecognized classes are also preserved.

Parameters:

Name Type Description
attributes Object

Attributes object to modify

classAttr string | null

Class attribute from an element

Source:

Set attributes from a class attribute

Unrecognized classes are also preserved.