Changeset 13479 for trunk/themes/elegant/scripts.js
- Timestamp:
- Mar 4, 2012, 10:45:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/elegant/scripts.js
r13464 r13479 3 3 var menubar=jQuery("#menubar"); 4 4 var content=jQuery("#content"); 5 5 6 6 if ( (menubar.length == 1) && (content.length ==1)) { 7 7 menubar.after("<div id=\"menuswitcher\">«</div>"); 8 /* if (!content.hasClass('content')) content.addClass('content');*/ 8 9 jQuery("#menuswitcher").click(function(){ 10 if (jQuery("#menubar").is(":hidden")) { 11 showMenu(0); 12 return false; 13 } else { 14 hideMenu(0); 15 return false; 16 } 17 }); 18 19 // creates a variable with the contents of the cookie side-menu 20 var sidemenu = jQuery.cookie('side-menu'); 21 22 // if cookie says the menu is hiding, keep it hidden! 23 if (sidemenu == 'hiding') { 24 hideMenu(0); 25 } else { 26 showMenu(0); 27 } 28 9 29 } 10 /*»*/11 30 12 jQuery("#menuswitcher").click(function(){ 13 if (jQuery("#menubar").is(":hidden")) { 14 showMenu(0); 15 return false; 31 var comments=jQuery("#thePicturePage #comments"); 32 if (comments.length == 1) { 33 var comments_button=jQuery("#comments h3"); 34 35 if (comments_button.length == 0) { 36 jQuery("#addComment").before("<h3>Comments</h3>"); 37 comments_button=jQuery("#comments h3"); 38 } 39 40 if (jQuery.cookie('comments') == 'visible') { 41 comments_button.addClass("comments_toggle").addClass("comments_toggle_off"); 16 42 } else { 17 hideMenu(0);18 return false;43 comments.addClass("comments_hidden"); 44 comments_button.addClass("comments_toggle").addClass("comments_toggle_on"); 19 45 } 20 }); 46 47 comments_button.click(function() { 21 48 22 // creates a variable with the contents of the cookie side-menu 23 var sidemenu = jQuery.cookie('side-menu'); 49 var comments=jQuery("#thePicturePage #comments"); 50 if (comments.hasClass("comments_hidden")) { 51 comments.removeClass("comments_hidden"); 52 comments_button.addClass("comments_toggle_off").removeClass("comments_toggle_on");; 53 jQuery.cookie('comments', 'visible', {path: "/"}); 54 } else { 55 comments.addClass("comments_hidden"); 56 comments_button.addClass("comments_toggle_on").removeClass("comments_toggle_off");; 57 jQuery.cookie('comments', 'hidden', {path: "/"}); 58 } 59 60 }); 24 61 25 // if cookie says the menu is hiding, keep it hidden!26 if (sidemenu == 'hiding') {27 hideMenu(0);28 } else {29 showMenu(0);30 62 } 31 63 32 64 33 65 });
Note: See TracChangeset
for help on using the changeset viewer.