Difference between revisions of "Template:Sidebar"
Adelo Vieira (talk | contribs) |
Adelo Vieira (talk | contribs) |
||
Line 192: | Line 192: | ||
#menu { | #menu { | ||
position: absolute; | position: absolute; | ||
− | width: | + | width: 300px; |
margin: -55px 0 0 -10px; | margin: -55px 0 0 -10px; | ||
padding: 50px 0px 30px 0px; | padding: 50px 0px 30px 0px; | ||
Line 399: | Line 399: | ||
// } | // } | ||
− | + | // Shortkey: https://www.techiedelight.com/create-keyboard-shortcuts-with-javascript-jquery-hotkeys-mousetrap-library/ | |
// For some reason, in MediaWiki pages, the && operator is not being interpreted by the web browser | // For some reason, in MediaWiki pages, the && operator is not being interpreted by the web browser | ||
// as such in «keydown» functions. The web browser is reading «&», instead of «&&» which generates a systax error. | // as such in «keydown» functions. The web browser is reading «&», instead of «&&» which generates a systax error. | ||
Line 433: | Line 433: | ||
// }); | // }); | ||
// } | // } | ||
+ | |||
+ | } | ||
+ | |||
+ | if ( event.ctrlKey ) { | ||
+ | if ( event.which === 89 ) { | ||
+ | var menuWidth = parseInt(window.getComputedStyle(document.getElementById("menu")).width) | ||
+ | if (menuWidth < 400 ) { | ||
+ | $('#menu').css('width','600px') | ||
+ | }else{ | ||
+ | $('#menu').css('width','300px') | ||
+ | } | ||
+ | } | ||
} | } | ||
Line 444: | Line 456: | ||
// } | // } | ||
// }); | // }); | ||
+ | |||
+ | |||
$(document).ready( function() { | $(document).ready( function() { |
Revision as of 16:46, 13 March 2021