Ligne 98 : |
Ligne 98 : |
| var w=$("#mw-panel").width();var l=parseInt($("#mw-panel").css("left"),10); | | var w=$("#mw-panel").width();var l=parseInt($("#mw-panel").css("left"),10); |
| var mc=parseInt($("#content").css("margin-left"),10); | | var mc=parseInt($("#content").css("margin-left"),10); |
− | if (l<0) {$("#mw-panel").css("left","0");$("#content").css("margin-left",(mc+w-10)+"px");$("#fl_ouv").html("❰");} | + | if (l<0) {$("#mw-panel").css("left","0");$("#content").css("margin-left",(mc+w-10)+"px"); |
− | else {$("#mw-panel").css("left",(10-w)+"px");$("#content").css("margin-left",(mc-w+10)+"px");$("#fl_ouv").html("❱");}}; | + | $("#fl_ouv").html("❰");setCookie("menu","1");} |
| + | else {$("#mw-panel").css("left",(10-w)+"px");$("#content").css("margin-left",(mc-w+10)+"px");$("#fl_ouv").html("❱");setCookie("menu","0");}}; |
| $(document).ready(function() { | | $(document).ready(function() { |
| $("#mw-panel").prepend($('<div id="fl_ouv">❰</div>')); | | $("#mw-panel").prepend($('<div id="fl_ouv">❰</div>')); |
− | $("#fl_ouv").on("click",plieSidebar);if (parseInt($("#content").width())<500) plieSidebar();}); | + | $("#fl_ouv").on("click",plieSidebar);var ouv=getCookie("menu"); |
| + | if (ouv==="" && parseInt($("#content").width())<500) {plieSidebar();setCookie("menu","0");} |
| + | if (ouv==="0") plieSidebar();}); |
| function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); | | function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); |
| for(var i = 0; i <ca.length; i++) { var c = ca[i]; | | for(var i = 0; i <ca.length; i++) { var c = ca[i]; |