Fix the bug where the first load of the accordion doesnt populate correctly

This commit is contained in:
james 2010-07-21 19:20:34 +00:00
parent a4ea8b2f4d
commit 5d06ea17e6
2 changed files with 8 additions and 3 deletions

View File

@ -78,7 +78,8 @@ function taskNav(id,pid,level) {
$("#tertiarymenu_accordion").accordion("destroy"); $("#tertiarymenu_accordion").accordion("destroy");
$("#tertiarymenu_accordion").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+id,null,function() { $("#tertiarymenu_accordion").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+id,null,function() {
$("#tertiarymenu_accordion").accordion({clearStyle: true}); //"option", "collapsible", true); $("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true);
$("#tertiarymenu_accordion").accordion("activate",false);
$("#tertiarymenu").show(); $("#tertiarymenu").show();
}); });
break; break;
@ -94,7 +95,7 @@ function taskNavLevel(l1,l2,l3,l4) {
$("#tertiarymenu_accordion").accordion("destroy"); $("#tertiarymenu_accordion").accordion("destroy");
$("#tertiarymenu_accordion").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+l2,null,function() { $("#tertiarymenu_accordion").load("<?=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+l2,null,function() {
$("#tertiarymenu_accordion").accordion({clearStyle: true}); //"option", "collapsible", true); $("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true);
$("#tertiarymenu").show(); $("#tertiarymenu").show();
$(".primarynav-selected").removeClass("primarynav-selected"); $(".primarynav-selected").removeClass("primarynav-selected");

View File

@ -30,8 +30,10 @@
case 1: //populate the scecondary menu case 1: //populate the scecondary menu
if($_SESSION['nav']['primary']!=$id) { if($_SESSION['nav']['primary']!=$id) {
$_SESSION['nav']['primary']=$id; $_SESSION['nav']['primary']=$id;
unset($_SESSION['nav']['secondary']);
} }
unset($_SESSION['nav']['secondary']);
unset($_SESSION['nav']['tertiary']);
unset($_SESSION['nav']['tertiarylink']);
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=1 ORDER By ord,task"); $q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=1 ORDER By ord,task");
echo "<ul class=\"secondarynav\">"; echo "<ul class=\"secondarynav\">";
$cl=""; $cl="";
@ -52,6 +54,8 @@
case 2: //populate the tertiary menu case 2: //populate the tertiary menu
$_SESSION['nav']['secondary']=$id; $_SESSION['nav']['secondary']=$id;
unset($_SESSION['nav']['tertiary']);
unset($_SESSION['nav']['tertiarylink']);
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=2 ORDER By ord,task"); $q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=2 ORDER By ord,task");
while($r=mysql_fetch_object($q)) { while($r=mysql_fetch_object($q)) {
echo "<h3 id=\"tertiary_nav_{$r->id}\"><a href=\"{$config['SFIABDIRECTORY']}$r->link\">".i18n("$r->task")."</a></h3>\n"; echo "<h3 id=\"tertiary_nav_{$r->id}\"><a href=\"{$config['SFIABDIRECTORY']}$r->link\">".i18n("$r->task")."</a></h3>\n";