HTMLUserTextField: Enable suggestions for non-OOUI mode
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Thu, 29 Oct 2015 18:00:59 +0000 (19:00 +0100)
committerFlorian <florian.schmidt.stargatewissen@gmail.com>
Sat, 30 Jan 2016 21:37:44 +0000 (22:37 +0100)
Bug: T117067
Change-Id: I03eabf6ed5d5a36534a5eec76c05d0a353ebf6ff

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 );
+       }
 }