Merge "VisualEditor: Ignore id when getting hash object"

This commit is contained in:
jenkins-bot 2015-09-14 16:53:47 +00:00 committed by Gerrit Code Review
commit 1dbf883b17
3 changed files with 18 additions and 3 deletions

View File

@ -34,7 +34,9 @@ ve.ce.MWMathNode.static.primaryCommandName = 'math';
/* Methods */
/** */
/**
* @inheritdoc
*/
ve.ce.MWMathNode.prototype.onSetup = function () {
// Parent method
ve.ce.MWMathNode.super.prototype.onSetup.call( this );

View File

@ -33,6 +33,21 @@ ve.dm.MWMathNode.static.tagName = 'img';
ve.dm.MWMathNode.static.extensionName = 'math';
/* Static methods */
/**
* @inheritdoc
*/
ve.dm.MWMathNode.static.getHashObject = function ( dataElement ) {
// Parent method
var hashObject = ve.dm.MWMathNode.super.static.getHashObject.call( this, dataElement );
// The id does not affect the rendering.
if ( hashObject.mw.attrs ) {
delete hashObject.mw.attrs.id;
}
return hashObject;
};
/* Registration */
ve.dm.modelRegistry.register( ve.dm.MWMathNode );

View File

@ -98,7 +98,6 @@ ve.ui.MWMathInspector.prototype.getSetupProcess = function ( data ) {
var display = this.selectedNode.getAttribute( 'mw' ).attrs.display || 'default';
this.displaySelect.selectItemByData( display );
this.displaySelect.on( 'choose', this.onChangeHandler );
this.idInput.on( 'change', this.onChangeHandler );
}, this );
};
@ -109,7 +108,6 @@ ve.ui.MWMathInspector.prototype.getTeardownProcess = function ( data ) {
return ve.ui.MWMathInspector.super.prototype.getTeardownProcess.call( this, data )
.first( function () {
this.displaySelect.off( 'choose', this.onChangeHandler );
this.idInput.off( 'change', this.onChangeHandler );
}, this );
};