Merge "HTMLUserTextField: Enable suggestions for non-OOUI mode"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 31 Jan 2016 11:39:42 +0000 (11:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 31 Jan 2016 11:39:42 +0000 (11:39 +0000)
includes/htmlform/HTMLUserTextField.php

index 9617c0a..8816d37 100644 (file)
@@ -44,4 +44,13 @@ class HTMLUserTextField extends HTMLTextField {
 
                return new UserInputWidget( $params );
        }
+
+       public function getInputHtml( $value ) {
+               // add the required module and css class for user suggestions in non-OOUI mode
+               $this->mParent->getOutput()->addModules( 'mediawiki.userSuggest' );
+               $this->mClass .= ' mw-autocomplete-user';
+
+               // return parent html
+               return parent::getInputHtml( $value );
+       }
 }