Merge "SearchInputWidget: Replace pushPending hack"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 2 May 2019 19:08:50 +0000 (19:08 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 2 May 2019 19:08:50 +0000 (19:08 +0000)
includes/widget/SearchInputWidget.php
resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js

index 6fed794..d4ffed2 100644 (file)
@@ -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;
index 818ad89..6a87583 100644 (file)
@@ -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;
                }