Support for node HTML attributes

Walk through node model attributes and pick just the HTML ones, then apply them to the DOM element

Change-Id: I7e0ffd71023ad692fcad7386b853410747398793
This commit is contained in:
Inez Korczyński 2012-11-14 14:21:36 -08:00
parent 6456177388
commit 2da5676fe1

View file

@ -26,6 +26,16 @@ ve.ce.Node = function VeCeNode( type, model, $element ) {
this.parent = null;
this.$.data( 'node', this );
// Walk through node model attributes and pick just the HTML ones,
// then apply them to the DOM element
var attributes = this.model.getAttributes(),
attribute;
for ( attribute in attributes ) {
if ( attribute.indexOf( 'html/' ) === 0 ) {
this.$.attr( attribute.substr( 5 ), attributes[attribute] );
}
}
};
/* Inheritance */