- * @inheritdoc
- * @protected
- */
- mw.widgets.SearchInputWidget.prototype.getInputElement = function () {
- return $( '<input>' ).attr( 'type', 'search' );
- };
-
- /**
- * @inheritdoc
- */
- mw.widgets.SearchInputWidget.prototype.onIndicatorMouseDown = function ( e ) {
- if ( e.which === OO.ui.MouseButtons.LEFT ) {
- // Clear the text field
- this.setValue( '' );
- this.$input[ 0 ].focus();
- return false;
- }
- };
-
- /**
- * Update the 'clear' indicator displayed on type: 'search' text
- * fields, hiding it when the field is already empty or when it's not
- * editable.
- */
- mw.widgets.SearchInputWidget.prototype.updateSearchIndicator = function () {
- if ( this.getValue() === '' || this.isDisabled() || this.isReadOnly() ) {
- this.setIndicator( null );
- } else {
- this.setIndicator( 'clear' );
- }
- };
-
- /**
- * @see OO.ui.SearchInputWidget#onChange
- */
- mw.widgets.SearchInputWidget.prototype.onChange = function () {
- mw.widgets.SearchInputWidget.parent.prototype.onChange.call( this );
- this.updateSearchIndicator();
- };
-
- /**
- * Handle disable events.
- *
- * @param {boolean} disabled Element is disabled
- * @private