mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
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:
parent
6456177388
commit
2da5676fe1
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue