From: Thierry Parmentelat Date: Tue, 29 Mar 2011 09:24:09 +0000 (+0200) Subject: use jstorage to store last toggle status X-Git-Tag: plewww-4.3-64~17 X-Git-Url: http://git.onelab.eu/?p=plewww.git;a=commitdiff_plain;h=7d4971597397caa302b9caf5d38c016139ab5b00 use jstorage to store last toggle status --- diff --git a/plekit/php/toggle.php b/plekit/php/toggle.php index 562ffd4..ee0dc0c 100644 --- a/plekit/php/toggle.php +++ b/plekit/php/toggle.php @@ -1,6 +1,7 @@ got '+$.jStorage.get(key,undefined)); + if ($.jStorage.get(key,true)) area.show(); + else area.hide(); } +////////// manage a toggle +// toggle it function plekit_toggle(id){ var area=$('toggle-area-'+id); @@ -37,18 +40,18 @@ function plekit_toggle_show(id) { if (!area.visible()) plekit_toggle (id); } -// open or close the info box +// toggle the attached info box function plekit_toggle_info(id){ // need to take care of the area as well var area=$('toggle-area-'+id); var info=$('toggle-info-'+id); if (area.visible() && info.visible()) { - window.console.log('PTI hiding'); +// window.console.log('PTI hiding'); info.hide(); } else { // make sure area is visible, take of the triggers - window.console.log('PTI showing'); +// window.console.log('PTI showing'); plekit_toggle_show(id); info.show(); }