Tchanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/238167

Change subject: VisualEditor: Ignore id when getting hash object
......................................................................

VisualEditor: Ignore id when getting hash object

Because the id doesn't affect the rendering of a
math node, it is not needed in the hash object.
Also removed event listner from the id input for
the same reason.

Bug: T112466
Change-Id: I4da07cb7c112ce9ab449a060132856a2d054e57f
---
M modules/VisualEditor/ve.ce.MWMathNode.js
M modules/VisualEditor/ve.dm.MWMathNode.js
M modules/VisualEditor/ve.ui.MWMathInspector.js
3 files changed, 18 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/67/238167/1

diff --git a/modules/VisualEditor/ve.ce.MWMathNode.js 
b/modules/VisualEditor/ve.ce.MWMathNode.js
index aa523a9..4b6bacd 100644
--- a/modules/VisualEditor/ve.ce.MWMathNode.js
+++ b/modules/VisualEditor/ve.ce.MWMathNode.js
@@ -34,7 +34,9 @@
 
 /* Methods */
 
-/** */
+/**
+ * @inheritdoc
+ */
 ve.ce.MWMathNode.prototype.onSetup = function () {
        // Parent method
        ve.ce.MWMathNode.super.prototype.onSetup.call( this );
diff --git a/modules/VisualEditor/ve.dm.MWMathNode.js 
b/modules/VisualEditor/ve.dm.MWMathNode.js
index 116efe6..7a20fad 100644
--- a/modules/VisualEditor/ve.dm.MWMathNode.js
+++ b/modules/VisualEditor/ve.dm.MWMathNode.js
@@ -33,6 +33,21 @@
 
 ve.dm.MWMathNode.static.extensionName = 'math';
 
+/* 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 );
diff --git a/modules/VisualEditor/ve.ui.MWMathInspector.js 
b/modules/VisualEditor/ve.ui.MWMathInspector.js
index d00644e..ecc866d 100644
--- a/modules/VisualEditor/ve.ui.MWMathInspector.js
+++ b/modules/VisualEditor/ve.ui.MWMathInspector.js
@@ -98,7 +98,6 @@
                        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 @@
        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 );
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/238167
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4da07cb7c112ce9ab449a060132856a2d054e57f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Tchanders <thalia.e.c...@googlemail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to