Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248836

Change subject: Check lookup button state when handle input 'enter' event
......................................................................

Check lookup button state when handle input 'enter' event

I021c60094 makes this check unnecessary, but this is still
logical and will prevent against regressions in the future.

Bug: T116471
Change-Id: I482a73db395bf6e63a88f76e38de23f23b1a77c3
---
M modules/ve.ui.CiteFromIdInspector.js
1 file changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Citoid 
refs/changes/36/248836/1

diff --git a/modules/ve.ui.CiteFromIdInspector.js 
b/modules/ve.ui.CiteFromIdInspector.js
index ee4785c..ff9f60e 100644
--- a/modules/ve.ui.CiteFromIdInspector.js
+++ b/modules/ve.ui.CiteFromIdInspector.js
@@ -200,7 +200,7 @@
        this.modeIndex.connect( this, { set: 'onModeIndexSet' } );
        this.lookupInput.connect( this, {
                change: 'onLookupInputChange',
-               enter: 'onLookupButtonClick'
+               enter: 'onLookupInputEnter'
        } );
        this.lookupButton.connect( this, { click: 'onLookupButtonClick' } );
        this.previewSelectWidget.connect( this, { choose: 
'onPreviewSelectWidgetChoose' } );
@@ -374,7 +374,16 @@
 };
 
 /**
- * Respond to lookup button click, perform lookup
+ * Handle enter events from the lookup input
+ */
+ve.ui.CiteFromIdInspector.prototype.onLookupInputEnter = function () {
+       if ( !this.lookupButton.isDisabled() ) {
+               this.onLookupButtonClick();
+       }
+};
+
+/**
+ * Handle click events from the lookup button, perform lookup
  */
 ve.ui.CiteFromIdInspector.prototype.onLookupButtonClick = function () {
        this.executeAction( 'lookup' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I482a73db395bf6e63a88f76e38de23f23b1a77c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Citoid
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>

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

Reply via email to