mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-16 10:50:52 +00:00
db29aa53bd
This extends the work in Ie29a1eb7746d56f7d8c99b74e5e3c213c30fdcf2 Bug: T171000 Change-Id: Ib125e1bdaace1893804892909c27a9f328445835
21 lines
562 B
JavaScript
21 lines
562 B
JavaScript
var SEARCH_CLASS = 'search-enabled';
|
|
|
|
module.exports = function () {
|
|
// eslint-disable-next-line no-jquery/no-global-selector
|
|
$( '#searchIcon' ).on( 'click', function () {
|
|
// eslint-disable-next-line no-jquery/no-global-selector
|
|
var $input = $( '#searchInput' ),
|
|
$body = $( document.body );
|
|
|
|
// eslint-disable-next-line no-jquery/no-sizzle
|
|
if ( !$input.is( ':visible' ) ) {
|
|
$body.addClass( SEARCH_CLASS );
|
|
$input.trigger( 'focus' )
|
|
.one( 'blur', function () {
|
|
$body.removeClass( SEARCH_CLASS );
|
|
} );
|
|
return false;
|
|
}
|
|
} );
|
|
};
|