MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
mw.loader.using( [ 'mediawiki.util' ] ).done( function() { | mw.loader.using( [ 'mediawiki.util' ] ).done( function() { | ||
if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) { | if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) { | ||
document.getElementById( 'skin-citizen-search-trigger' ).addEventListener( 'click', function() { | $(document).ready(function() { | ||
var searchButton = document.getElementById( 'skin-citizen-search-trigger' ); | |||
if (searchButton) { | |||
searchButton.addEventListener( 'click', function() { | |||
var searchDetails = document.getElementById( 'citizen-search-details' ); | |||
} ); | if (searchDetails) { | ||
searchDetails.open = true; | |||
// Focus on the search input | |||
setTimeout(function() { | |||
var searchInput = document.getElementById( 'searchInput' ); | |||
if (searchInput) { | |||
searchInput.focus(); | |||
} | |||
}, 100); | |||
} | |||
}); | |||
} | |||
}); | |||
} | } | ||
} ); | }); | ||
Revision as of 04:48, 2 January 2026
mw.loader.using( [ 'mediawiki.util' ] ).done( function() {
if ( mw.config.get( 'wgPageName' ) === 'Main_Page' ) {
$(document).ready(function() {
var searchButton = document.getElementById( 'skin-citizen-search-trigger' );
if (searchButton) {
searchButton.addEventListener( 'click', function() {
var searchDetails = document.getElementById( 'citizen-search-details' );
if (searchDetails) {
searchDetails.open = true;
// Focus on the search input
setTimeout(function() {
var searchInput = document.getElementById( 'searchInput' );
if (searchInput) {
searchInput.focus();
}
}, 100);
}
});
}
});
}
});