Esanders has uploaded a new change for review.

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

Change subject: Replace updatePreview with updateMwData
......................................................................

Replace updatePreview with updateMwData

No need to reimplement updatePreview, just override updateMwData instead.

Change-Id: I606fb200c458aff979df660d3b7095bb52c5d012
---
M modules/VisualEditor/ve.ui.MWMathInspector.js
1 file changed, 6 insertions(+), 9 deletions(-)


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

diff --git a/modules/VisualEditor/ve.ui.MWMathInspector.js 
b/modules/VisualEditor/ve.ui.MWMathInspector.js
index 2c20971..d00644e 100644
--- a/modules/VisualEditor/ve.ui.MWMathInspector.js
+++ b/modules/VisualEditor/ve.ui.MWMathInspector.js
@@ -96,7 +96,7 @@
        return ve.ui.MWMathInspector.super.prototype.getSetupProcess.call( 
this, data )
                .next( function () {
                        var display = this.selectedNode.getAttribute( 'mw' 
).attrs.display || 'default';
-                       this.displaySelect.selectItem( 
this.displaySelect.getItemFromData( display ) );
+                       this.displaySelect.selectItemByData( display );
                        this.displaySelect.on( 'choose', this.onChangeHandler );
                        this.idInput.on( 'change', this.onChangeHandler );
                }, this );
@@ -116,18 +116,15 @@
 /**
  * @inheritdoc
  */
-ve.ui.MWMathInspector.prototype.updatePreview = function () {
-       var mwData = ve.copy( this.selectedNode.getAttribute( 'mw' ) ),
-               display = this.displaySelect.getSelectedItem().getData(),
+ve.ui.MWMathInspector.prototype.updateMwData = function ( mwData ) {
+       // Parent method
+       ve.ui.MWMathInspector.super.prototype.updateMwData.call( this, mwData );
+
+       var display = this.displaySelect.getSelectedItem().getData(),
                id = this.idInput.getValue();
 
-       mwData.body.extsrc = this.input.getValue();
        mwData.attrs.display = display !== 'default' ? display : undefined;
        mwData.attrs.id = id || undefined;
-
-       if ( this.visible ) {
-               this.getFragment().changeAttributes( { mw: mwData } );
-       }
 };
 
 /* Registration */

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I606fb200c458aff979df660d3b7095bb52c5d012
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to