MediaWiki:Common.js: Difference between revisions
MediaWiki interface page
More actions
No edit summary |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 5: | Line 5: | ||
if (searchButton) { | if (searchButton) { | ||
searchButton.addEventListener( 'click', function() { | searchButton.addEventListener( 'click', function() { | ||
var | // Click the search summary button to trigger the dropdown | ||
if ( | var searchSummary = document.getElementById( 'citizen-search-summary' ); | ||
if (searchSummary) { | |||
searchSummary.click(); | |||
} | } | ||
}); | }); | ||
| Line 20: | Line 14: | ||
}); | }); | ||
} | } | ||
}); | |||
$(document).ready(function() { | |||
$('.event-banner').on('click', function() { | |||
window.location.href = $(this).data('href'); | |||
}); | |||
}); | }); | ||
Latest revision as of 21:58, 9 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() {
// Click the search summary button to trigger the dropdown
var searchSummary = document.getElementById( 'citizen-search-summary' );
if (searchSummary) {
searchSummary.click();
}
});
}
});
}
});
$(document).ready(function() {
$('.event-banner').on('click', function() {
window.location.href = $(this).data('href');
});
});