JGirault has submitted this change and it was merged.

Change subject: Update scalable object when setting dimensions
......................................................................


Update scalable object when setting dimensions

This scalable object is cached, so this is required for
the dialog to open with the correct size the second time.

Also use bounded dimensions when updating the preview.

Bug: T134006
Change-Id: I771ec667c9af9fa64158fbc7a3435bc6a113d2c5
---
M modules/ve-maps/ve.ui.MWMapsDialog.js
1 file changed, 18 insertions(+), 1 deletion(-)

Approvals:
  JGirault: Verified; Looks good to me, approved



diff --git a/modules/ve-maps/ve.ui.MWMapsDialog.js 
b/modules/ve-maps/ve.ui.MWMapsDialog.js
index 4260396..3dd999b 100644
--- a/modules/ve-maps/ve.ui.MWMapsDialog.js
+++ b/modules/ve-maps/ve.ui.MWMapsDialog.js
@@ -109,7 +109,9 @@
                return;
        }
 
-       dimensions = this.dimensions.getDimensions();
+       dimensions = this.scalable.getBoundedDimensions(
+               this.dimensions.getDimensions()
+       );
        center = this.map && this.map.getCenter();
 
        // Set container width for centering
@@ -164,6 +166,21 @@
 /**
  * @inheritdoc ve.ui.MWExtensionWindow
  */
+ve.ui.MWMapsDialog.prototype.insertOrUpdateNode = function () {
+       // Parent method
+       ve.ui.MWMapsDialog.super.prototype.insertOrUpdateNode.apply( this, 
arguments );
+
+       // Update scalable
+       this.scalable.setCurrentDimensions(
+               this.scalable.getBoundedDimensions(
+                       this.dimensions.getDimensions()
+               )
+       );
+};
+
+/**
+ * @inheritdoc ve.ui.MWExtensionWindow
+ */
 ve.ui.MWMapsDialog.prototype.updateMwData = function ( mwData ) {
        var center, latitude, longitude, zoom,
                dimensions = this.scalable.getBoundedDimensions(

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I771ec667c9af9fa64158fbc7a3435bc6a113d2c5
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: JGirault <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Yurik <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to