MediaWiki:Common.js: Difference between revisions
From Ghost Theory Wiki
No edit summary Tag: Manual revert |
No edit summary |
||
| Line 1: | Line 1: | ||
mw.loader.using(['jquery'], function () { | |||
$(function () { | $(function () { | ||
// Insert the sidebar toggle button next to the site title | |||
var banner = $('#p-banner'); | |||
$('# | |||
if (banner.length && !document.getElementById('mw-sidebar-button')) { | |||
banner.after( | |||
'<button id="mw-sidebar-button" class="mw-ui-icon mw-ui-icon-element mw-ui-icon-menu" style="margin-left:10px;"><span>Menu</span></button>' | |||
); | |||
} | |||
// Toggle sidebar on desktop | |||
$(document).on('click', '#mw-sidebar-button', function () { | |||
$('body').toggleClass('sidebar-open'); | |||
}); | |||
}); | }); | ||
}); | }); | ||
