Esanders has uploaded a new change for review.

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

Change subject: Setup and teardown events
......................................................................

Setup and teardown events

Prevents things like this.dimensions.clear() triggering
unnecessary redraws.

Change-Id: Ie8d397e42070772bafe5dbbce633e3095fe9ddac
---
M modules/ve-maps/ve.ui.MWMapsDialog.js
1 file changed, 16 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/82/285382/1

diff --git a/modules/ve-maps/ve.ui.MWMapsDialog.js 
b/modules/ve-maps/ve.ui.MWMapsDialog.js
index 1a03f11..706b4f9 100644
--- a/modules/ve-maps/ve.ui.MWMapsDialog.js
+++ b/modules/ve-maps/ve.ui.MWMapsDialog.js
@@ -71,17 +71,6 @@
                label: ve.msg( 'visualeditor-mwmapsdialog-reset-map' )
        } );
 
-       // Events
-       this.input.connect( this, {
-               change: 'updateGeoJson',
-               resize: 'updateSize'
-       } );
-       this.dimensions.connect( this, {
-               widthChange: 'onDimensionsChange',
-               heightChange: 'onDimensionsChange'
-       } );
-       this.resetMapButton.connect( this, { click: 'resetMapPosition' } );
-
        panel = new OO.ui.PanelLayout( {
                padded: true,
                expanded: false
@@ -235,6 +224,17 @@
                                this.scalable = 
ve.dm.MWMapsNode.static.createScalable( { width: 400, height: 300 } );
                        }
 
+                       // Events
+                       this.input.connect( this, {
+                               change: 'updateGeoJson',
+                               resize: 'updateSize'
+                       } );
+                       this.dimensions.connect( this, {
+                               widthChange: 'onDimensionsChange',
+                               heightChange: 'onDimensionsChange'
+                       } );
+                       this.resetMapButton.connect( this, { click: 
'resetMapPosition' } );
+
                        // TODO: Support block/inline conversion
 
                        this.$resetMapButtonContainer.toggle( 
!!this.selectedNode );
@@ -357,6 +357,11 @@
 ve.ui.MWMapsDialog.prototype.getTeardownProcess = function ( data ) {
        return ve.ui.MWMapsDialog.super.prototype.getTeardownProcess.call( 
this, data )
                .first( function () {
+                       // Events
+                       this.input.disconnect( this );
+                       this.dimensions.disconnect( this );
+                       this.resetMapButton.disconnect( this );
+
                        this.dimensions.clear();
                        if ( this.map ) {
                                this.map.remove();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8d397e42070772bafe5dbbce633e3095fe9ddac
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
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