Home User Documentation Developer Documentation GitHub

Class: ElementAttributes

plastic. ElementAttributes

new plastic.ElementAttributes()

core/ElementAttributes.js, line 13

Plastic ElementAttributes Prototype

Creates a new ElementAttributes Object which stores all the Informations from the plastic.js element markup

TODO
  • Refactoring: Direct access to parent (plasticElement) attributes where it makes sense
Example

this.attr = new plastic.ElementAttributes(el);

Members

$elObject

plastic.js jQuery DOM Element

attrObjSchemaObject

JSON Schema for validation

dataObject boolean

Element Data Attributes

descriptionObject

Element Data Description

displayObject boolean

Element Display Attributes

optionsObject boolean

Element Options Attributes

pElObject

plastic.js Element

queryObject boolean

Element Query Attributes

styleObject

Element Style Attributes

Methods

getAttrObj(){Object}

core/ElementAttributes.js, line 146

Returns a compact, current Attribute Object Removes all main-attributes which are flagged with false

getDataFromElement(className, required, isPlainText){*}

core/ElementAttributes.js, line 254

Gets all attributes and data from a plastic sub-element

Name Type Description
className String

class name of element

required Boolean

if element is required

isPlainText Boolean

if content of element is plain text instead of JSON

getStyle()

core/ElementAttributes.js, line 238

Gets width and height of the element They are calculated directly from the DOM Element style

parse(){Object}

core/ElementAttributes.js, line 171

Parses all Attributes of the plastic.js element

parseHTMLAPI()

core/ElementAttributes.js, line 195

Parses a plastic.js tag that uses HTML as its API

parseJSONAPI()

core/ElementAttributes.js, line 208

Parses a plastic.js tag that uses pure JSON as API

validate(){Object|boolean}

core/ElementAttributes.js, line 314

Validates the parsed ElementAttributes Data