DLynch has uploaded a new change for review.
https://gerrit.wikimedia.org/r/304594
Change subject: Dialog must listen for changes to the param names
......................................................................
Dialog must listen for changes to the param names
Otherwise the second keystroke made while changing parameter names will cause
an error. I think this code previously assumed the change only happened once,
rather than on-keystroke.
Bug: T142889
Change-Id: I0e9c096a053667c51bbce74ee3ce1bd573ae7d49
---
M modules/ext.templateDataGenerator.ui.tdDialog.js
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TemplateData
refs/changes/94/304594/1
diff --git a/modules/ext.templateDataGenerator.ui.tdDialog.js
b/modules/ext.templateDataGenerator.ui.tdDialog.js
index 0883dbc..4e23e6c 100644
--- a/modules/ext.templateDataGenerator.ui.tdDialog.js
+++ b/modules/ext.templateDataGenerator.ui.tdDialog.js
@@ -281,6 +281,21 @@
};
/**
+ * Respond to change of param property from the model
+ *
+ * @param {string} paramKey Parameter key
+ * @param {string} prop Property name
+ * @param {...Mixed} value Property value
+ * @param {string} [language] Value language
+ */
+mw.TemplateData.Dialog.prototype.onModelChangeProperty = function ( paramKey,
prop, value ) {
+ // Refresh the parameter widget
+ if ( paramKey === this.selectedParamKey && prop === 'name' ) {
+ this.selectedParamKey = value;
+ }
+};
+
+/**
* Respond to a change in the model
*/
mw.TemplateData.Dialog.prototype.onModelChange = function () {
@@ -804,6 +819,7 @@
this.model.connect( this, {
'change-description':
'onModelChangeDescription',
'change-paramOrder': 'onModelChangeParamOrder',
+ 'change-property': 'onModelChangeProperty',
change: 'onModelChange'
} );
--
To view, visit https://gerrit.wikimedia.org/r/304594
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e9c096a053667c51bbce74ee3ce1bd573ae7d49
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TemplateData
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits