Constructor
new ve.dm.ClassAttributeNode()abstract
#
Children
DataModel class-attribute node.
Used for nodes which use classes to store attributes.
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:
Mapping from class names to attributes
e.g.
Methods
getClassAttrFromAttributes(attributes) → {string|null
}static
#
null
}static
#
Get class attribute from element attributes
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Object
|
undefined
|
Element attributes |
Returns:
Class name, or null if no classes to set
- Type
-
string
|
null
Get class attribute from element attributes
sanitize()static
#
- Source:
- See:
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 |
Set attributes from a class attribute
Unrecognized classes are also preserved.