Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/248616
Change subject: Disable input field on lookup, too
......................................................................
Disable input field on lookup, too
The lookup action is bound to the lookup input field, too (on key return),
so an user could submit the form twice (press return twice or click generate
button and press return), which would trigger an error message. To avoid that,
disable the input field, too, while the lookup processed.
Bug: T116471
Change-Id: I021c60094331d8816f20d3739f12726ce3df217a
---
M modules/ve.ui.CiteFromIdInspector.js
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Citoid
refs/changes/16/248616/1
diff --git a/modules/ve.ui.CiteFromIdInspector.js
b/modules/ve.ui.CiteFromIdInspector.js
index ee4785c..5e816e2 100644
--- a/modules/ve.ui.CiteFromIdInspector.js
+++ b/modules/ve.ui.CiteFromIdInspector.js
@@ -501,6 +501,7 @@
}
// Set as pending
this.lookupButton.setDisabled( true );
+ this.lookupInput.setDisabled( true );
this.lookupInput.pushPending();
// We have to first set up a get response so we can have
@@ -539,6 +540,11 @@
.always( function () {
inspector.lookupInput.popPending();
inspector.lookupButton.setDisabled( false );
+ inspector
+ .lookupInput
+ .setDisabled( false )
+ // restore focus to the input field
+ .focus();
} )
.promise( { abort: xhr.abort } );
return this.lookupPromise;
--
To view, visit https://gerrit.wikimedia.org/r/248616
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I021c60094331d8816f20d3739f12726ce3df217a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits