Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Follow up I2480149
......................................................................

Follow up I2480149

Implemented Krinkle's comments.

Change-Id: I8e51c0d3a3ca1690ea3ea08469a1cd52d9c151f3
---
M includes/widget/SearchInputWidget.php
M resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/284239/1

diff --git a/includes/widget/SearchInputWidget.php 
b/includes/widget/SearchInputWidget.php
old mode 100644
new mode 100755
index 5ff411d..105189d
--- a/includes/widget/SearchInputWidget.php
+++ b/includes/widget/SearchInputWidget.php
@@ -16,6 +16,7 @@
        protected $performSearchOnClick = true;
        protected $validateTitle = false;
        protected $highlightFirst = false;
+       protected $dataLocation = 'content';
 
        /**
         * @param array $config Configuration options
@@ -24,6 +25,8 @@
         * @param boolean|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)
+        * @param string $config['dataLocation'] Where the search input field 
will be
+        *  used (header or content, default: header)
         */
        public function __construct( array $config = [] ) {
                $config = array_merge( [
@@ -31,7 +34,7 @@
                        'maxLength' => null,
                        'type' => 'search',
                        'icon' => 'search',
-                       'dataLocation' => 'content',
+                       'dataLocation' => 'header',
                ], $config );
 
                // Parent constructor
diff --git a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
old mode 100644
new mode 100755
index 8c2b53a..df03679
--- a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
@@ -18,13 +18,16 @@
         * @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.
+        *  @cfg {string} [dataLocation='header'] Where the search input field 
will be
+        *  used (header or content).
         */
        mw.widgets.SearchInputWidget = function MwWidgetsSearchInputWidget( 
config ) {
                config = $.extend( {
                        type: 'search',
                        icon: 'search',
                        maxLength: undefined,
-                       performSearchOnClick: true
+                       performSearchOnClick: true,
+                       dataLocation: 'header'
                }, config );
 
                // Parent constructor

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e51c0d3a3ca1690ea3ea08469a1cd52d9c151f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to