*/
class SearchInputWidget extends TitleInputWidget {
- protected $pushPending = false;
protected $performSearchOnClick = true;
protected $validateTitle = false;
protected $highlightFirst = false;
protected $dataLocation = 'header';
+ protected $showDescriptions = false;
/**
* @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)
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'];
}
$this->dataLocation = $config['dataLocation'];
}
+ if ( !empty( $config['showDescriptions'] ) ) {
+ $this->showDescriptions = true;
+ }
+
// Initialization
$this->addClasses( [ 'mw-widget-searchInputWidget' ] );
}
}
public function getConfig( &$config ) {
- $config['pushPending'] = $this->pushPending;
$config['performSearchOnClick'] = $this->performSearchOnClick;
if ( $this->dataLocation ) {
$config['dataLocation'] = $this->dataLocation;
}
+ if ( $this->showDescriptions ) {
+ $config['showDescriptions'] = true;
+ }
$config['$overlay'] = true;
return parent::getConfig( $config );
}