Difference between revisions of "Template:Sidebar"
Adelo Vieira (talk | contribs) |
Adelo Vieira (talk | contribs) |
||
Line 388: | Line 388: | ||
$('#menuToggle li').css({'margin-bottom':'','margin-top':''}) | $('#menuToggle li').css({'margin-bottom':'','margin-top':''}) | ||
$('#menuToggle p ').css({'margin-bottom':'','margin-top':''}) | $('#menuToggle p ').css({'margin-bottom':'','margin-top':''}) | ||
+ | } | ||
+ | |||
+ | function collapseSome() { | ||
+ | $(".mw-collapsible").not('.keep-abierto').addClass("mw-collapsed"); | ||
} | } | ||
function collapseAll() { | function collapseAll() { | ||
− | + | $(".mw-collapsible").addClass("mw-collapsed"); | |
} | } | ||
+ | |||
+ | $(document).keydown(function(event) { | ||
+ | if ( event.ctrlKey ) { | ||
+ | if ( event.which === 37 ) { // Check key codes here: https://css-tricks.com/snippets/javascript/javascript-keycodes/ | ||
+ | $(document).ready( function() { | ||
+ | $('#totalItems, #enteredItems').keyup(function(){ | ||
+ | function collapseAll() | ||
+ | }); | ||
+ | function collapseAll() | ||
+ | }); | ||
+ | } | ||
+ | } | ||
+ | }); | ||
// function moveSidebarToBody() { | // function moveSidebarToBody() { | ||
Line 402: | Line 419: | ||
$('#totalItems, #enteredItems').keyup(function(){ | $('#totalItems, #enteredItems').keyup(function(){ | ||
checkUser() | checkUser() | ||
− | + | collapseSome() | |
removeCSS() | removeCSS() | ||
// moveSidebarToBody() | // moveSidebarToBody() | ||
}); | }); | ||
checkUser() | checkUser() | ||
− | + | collapseSome() | |
removeCSS() | removeCSS() | ||
// moveSidebarToBody() | // moveSidebarToBody() |
Revision as of 23:06, 12 March 2021