jenkins-bot has submitted this change and it was merged.

Change subject: VisualEditor: Fix size of raw input after spec has been changed
......................................................................


VisualEditor: Fix size of raw input after spec has been changed

Change-Id: Iadb4e5425060e4a1f13e96d00f80cf38b3f79919
---
M modules/ve-graph/ve.ui.MWGraphDialog.js
1 file changed, 23 insertions(+), 12 deletions(-)

Approvals:
  Mooeypoo: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve-graph/ve.ui.MWGraphDialog.js 
b/modules/ve-graph/ve.ui.MWGraphDialog.js
index ffa0d5d..5a980bd 100644
--- a/modules/ve-graph/ve.ui.MWGraphDialog.js
+++ b/modules/ve-graph/ve.ui.MWGraphDialog.js
@@ -134,14 +134,10 @@
 
        this.rawPage.$element.append( jsonTextField.$element );
 
-       // Event handlers
-       this.jsonTextInput.connect( this, {
-               change: 'onSpecStringInputChange'
-       } );
-
-       this.graphTypeDropdownInput.connect( this, {
-               change: 'onGraphTypeInputChange'
-       } );
+       // Events
+       this.jsonTextInput.connect( this, { change: 'onSpecStringInputChange' } 
);
+       this.graphTypeDropdownInput.connect( this, { change: 
'onGraphTypeInputChange' } );
+       this.rootLayout.connect( this, { set: 'onRootLayoutSet' } );
 
        // Initialization
        this.$body.append( this.rootLayout.$element );
@@ -317,7 +313,7 @@
 };
 
 /**
- * React to spec string input change
+ * Handle spec string input change
  *
  * @private
  * @param {string} value The text input value
@@ -338,9 +334,9 @@
 };
 
 /**
- * React to graph type changes
+ * Handle graph type changes
  *
- * @param {string} [value] The new graph type
+ * @param {string} value The new graph type
  */
 ve.ui.MWGraphDialog.prototype.onGraphTypeInputChange = function ( value ) {
        this.unknownGraphTypeWarningLabel.toggle( value === 'unknown' );
@@ -372,7 +368,22 @@
 };
 
 /**
- * React to spec change
+ * Handle page set events on the root layout
+ *
+ * @param {OO.ui.PageLayout} page Set page
+ */
+ve.ui.MWGraphDialog.prototype.onRootLayoutSet = function ( page ) {
+       if ( page.getName() === 'raw' ) {
+               // The raw data may have been changed while not visible,
+               // so recalculate height now it is visible.
+               // HACK: Invalidate value cache
+               this.jsonTextInput.valCache = null;
+               this.jsonTextInput.adjustSize();
+       }
+};
+
+/**
+ * Handle model spec change events
  *
  * @private
  */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iadb4e5425060e4a1f13e96d00f80cf38b3f79919
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Mooeypoo <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to