From b4cac600761d9f54a2af389dc394be061fad292c Mon Sep 17 00:00:00 2001 From: flop25 Date: Sun, 16 Jun 2013 14:22:35 +0000 Subject: feature:2924 adding 3 options for the default behaviour of the panels ToDo lang files git-svn-id: http://piwigo.org/svn/trunk@23251 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/elegant/scripts_pp.js | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'themes/elegant/scripts_pp.js') diff --git a/themes/elegant/scripts_pp.js b/themes/elegant/scripts_pp.js index 79d700ebb..bf7e1531d 100644 --- a/themes/elegant/scripts_pp.js +++ b/themes/elegant/scripts_pp.js @@ -77,15 +77,19 @@ jQuery("document").ready(function(jQuery){ var sidemenu = jQuery.cookie('picture-menu'); var menubar=jQuery("#menubar"); - if (menubar.length == 1) { + if (menubar.length == 1 && p_main_menu!="disabled") { jQuery("#menuSwitcher").html("
 
"); // if cookie says the menu is hiding, keep it hidden! - if (sidemenu == 'visible') { + if (sidemenu == 'hidden') { + hideMenu(0); + } else if (sidemenu == 'visible') { showMenu(0); - } else { + } else if (p_main_menu == 'off') { hideMenu(0); + } else { + showMenu(0); } jQuery("#menuSwitcher").click(function(){ @@ -105,13 +109,17 @@ jQuery("document").ready(function(jQuery){ var sideinfo = jQuery.cookie('side-info'); var imageInfos=jQuery("#imageInfos"); - if (imageInfos.length == 1) { + if (imageInfos.length == 1 && p_pict_descr!="disabled") { jQuery("#infoSwitcher").html("
 
"); // if cookie says the menu is hiding, keep it hidden! if (sideinfo == 'hidden') { hideInfo(0); + } else if (sideinfo == 'visible') { + showInfo(0); + } else if (p_pict_descr == 'off') { + hideInfo(0); } else { showInfo(0); } @@ -135,7 +143,7 @@ jQuery("document").ready(function(jQuery){ commentsswicther.html("
 
"); - if (comments.length == 1) { + if (comments.length == 1 && p_pict_comment!="disabled") { var comments_button=jQuery("#comments h3"); if (comments_button.length == 0) { @@ -143,12 +151,18 @@ jQuery("document").ready(function(jQuery){ comments_button=jQuery("#comments h3"); } - if (jQuery.cookie('comments') == 'visible') { + if (jQuery.cookie('comments') == 'hidden') { + comments.addClass("commentshidden"); + comments_button.addClass("comments_toggle").addClass("comments_toggle_on"); + } else if (jQuery.cookie('comments') == 'visible') { comments.addClass("commentsshown"); comments_button.addClass("comments_toggle").addClass("comments_toggle_off"); - } else { + } else if (p_pict_comment == 'off') { comments.addClass("commentshidden"); comments_button.addClass("comments_toggle").addClass("comments_toggle_on"); + } else { + comments.addClass("commentsshown"); + comments_button.addClass("comments_toggle").addClass("comments_toggle_off"); } comments_button.click(function() { commentsToggle() }); -- cgit v1.2.3