Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/232740
Change subject: Fix size of raw input after spec has been changed
......................................................................
Fix size of raw input after spec has been changed
Change-Id: Iadb4e5425060e4a1f13e96d00f80cf38b3f79919
---
M modules/VisualEditor/ve.ui.MWGraphDialog.js
1 file changed, 23 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph
refs/changes/40/232740/1
diff --git a/modules/VisualEditor/ve.ui.MWGraphDialog.js
b/modules/VisualEditor/ve.ui.MWGraphDialog.js
index 4d4c741..7fed9ec 100644
--- a/modules/VisualEditor/ve.ui.MWGraphDialog.js
+++ b/modules/VisualEditor/ve.ui.MWGraphDialog.js
@@ -125,14 +125,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 );
@@ -249,7 +245,7 @@
};
/**
- * React to spec string input change
+ * Handle spec string input change
*
* @private
* @param {string} value The text input value
@@ -270,9 +266,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' );
@@ -283,7 +279,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: newchange
Gerrit-Change-Id: Iadb4e5425060e4a1f13e96d00f80cf38b3f79919
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits