Merge "Make TitleInputWidget configurable, if term should be highlighted or not"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 11 Nov 2015 17:11:22 +0000 (17:11 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 11 Nov 2015 17:11:22 +0000 (17:11 +0000)
includes/widget/TitleInputWidget.php

index 5550a21..25030b1 100644 (file)
@@ -39,6 +39,9 @@ class TitleInputWidget extends \OOUI\TextInputWidget {
                if ( isset( $config['suggestions'] ) ) {
                        $this->suggestions = $config['suggestions'];
                }
+               if ( isset( $config['highlightFirst'] ) ) {
+                       $this->highlightFirst = $config['highlightFirst'];
+               }
 
                // Initialization
                $this->addClasses( array( 'mw-widget-titleInputWidget' ) );
@@ -58,6 +61,9 @@ class TitleInputWidget extends \OOUI\TextInputWidget {
                if ( $this->suggestions !== null ) {
                        $config['suggestions'] = $this->suggestions;
                }
+               if ( $this->highlightFirst !== null ) {
+                       $config['highlightFirst'] = $this->highlightFirst;
+               }
                return parent::getConfig( $config );
        }
 }