From e8a2f22aae4800da0714c3e8a738074f62905eae Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 2 May 2019 17:15:20 +0100 Subject: [PATCH] SearchInputWidget: Replace pushPending hack Use the showPendingRequest config option instead of setting a prototype method to false. Bug: T222329 Change-Id: I0e3176141c63ed9a849326c2f9a5a26ffc2b273f --- includes/widget/SearchInputWidget.php | 8 -------- .../src/mediawiki.widgets/mw.widgets.SearchInputWidget.js | 6 +----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/includes/widget/SearchInputWidget.php b/includes/widget/SearchInputWidget.php index 6fed794256..d4ffed2c8c 100644 --- a/includes/widget/SearchInputWidget.php +++ b/includes/widget/SearchInputWidget.php @@ -10,7 +10,6 @@ namespace MediaWiki\Widget; */ class SearchInputWidget extends TitleInputWidget { - protected $pushPending = false; protected $performSearchOnClick = true; protected $validateTitle = false; protected $highlightFirst = false; @@ -18,8 +17,6 @@ class SearchInputWidget extends TitleInputWidget { /** * @param array $config Configuration options - * - int|null $config['pushPending'] Whether the input should be visually marked as - * "pending", while requesting suggestions (default: false) * - bool|null $config['performSearchOnClick'] If true, the script will start a search * whenever a user hits a suggestion. If false, the text of the suggestion is inserted into * the text field only (default: true) @@ -35,10 +32,6 @@ class SearchInputWidget extends TitleInputWidget { parent::__construct( $config ); // Properties, which are ignored in PHP and just shipped back to JS - if ( isset( $config['pushPending'] ) ) { - $this->pushPending = $config['pushPending']; - } - if ( isset( $config['performSearchOnClick'] ) ) { $this->performSearchOnClick = $config['performSearchOnClick']; } @@ -61,7 +54,6 @@ class SearchInputWidget extends TitleInputWidget { } public function getConfig( &$config ) { - $config['pushPending'] = $this->pushPending; $config['performSearchOnClick'] = $this->performSearchOnClick; if ( $this->dataLocation ) { $config['dataLocation'] = $this->dataLocation; diff --git a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js index 818ad89b21..6a875830d7 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js @@ -14,8 +14,6 @@ * * @constructor * @param {Object} [config] Configuration options - * @cfg {boolean} [pushPending=false] Visually mark the input field as "pending", while - * requesting suggestions. * @cfg {boolean} [performSearchOnClick=true] If true, the script will start a search when- * ever a user hits a suggestion. If false, the text of the suggestion is inserted into the * text field only. @@ -32,6 +30,7 @@ config = $.extend( { icon: 'search', maxLength: undefined, + showPendingRequest: false, performSearchOnClick: true, dataLocation: 'header' }, config ); @@ -43,9 +42,6 @@ this.$element.addClass( 'mw-widget-searchInputWidget' ); this.lookupMenu.$element.addClass( 'mw-widget-searchWidget-menu' ); this.lastLookupItems = []; - if ( !config.pushPending ) { - this.pushPending = false; - } if ( config.dataLocation ) { this.dataLocation = config.dataLocation; } -- 2.20.1