Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/291722
Change subject: uw.CopyMetadataWidget: Make the 'Copy' button disabled if
there's nothing to copy
......................................................................
uw.CopyMetadataWidget: Make the 'Copy' button disabled if there's nothing to
copy
Bug: T43999
Change-Id: I9f2f5611eef147cc5bd76e61e5a6a63ba40feab9
---
M resources/uw.CopyMetadataWidget.js
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/22/291722/1
diff --git a/resources/uw.CopyMetadataWidget.js
b/resources/uw.CopyMetadataWidget.js
index 7ee759d..aa5675b 100644
--- a/resources/uw.CopyMetadataWidget.js
+++ b/resources/uw.CopyMetadataWidget.js
@@ -46,6 +46,9 @@
label: mw.message(
'mwe-upwiz-copy-metadata-button-undo' ).text()
} );
+ this.checkboxesWidget.connect( this, {
+ select: 'onCheckboxesSelect'
+ } );
this.copyButton.connect( this, {
click: 'onCopyClick'
} );
@@ -93,6 +96,15 @@
};
/**
+ * Checkbox multiselect widget select event handler.
+ *
+ * @private
+ */
+ uw.CopyMetadataWidget.prototype.onCheckboxesSelect = function () {
+ this.copyButton.setDisabled(
this.checkboxesWidget.getSelectedItemsData().length === 0 );
+ };
+
+ /**
* Button click event handler.
*
* @private
--
To view, visit https://gerrit.wikimedia.org/r/291722
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f2f5611eef147cc5bd76e61e5a6a63ba40feab9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits