mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-23 22:50:09 +03:00
feature #2166: If parent tab does not exists and sub tab in the first level
This commit is contained in:
parent
2b876c3d94
commit
403a555e22
@ -550,21 +550,16 @@ function insertTab(tab_name){
|
||||
|
||||
var li_item = '<li id="li_'+tab_name+'" class="'+tabClass+' '+parent+'"><a href="#">'+tab_info.title+'<span class="icon-caret-left icon-large plusIcon right"></span></a></li>';
|
||||
|
||||
$('div#menu ul#navigation').append(li_item);
|
||||
|
||||
//if this is a submenu...
|
||||
if (parent.length) {
|
||||
var children = $('div#menu ul#navigation li.'+parent);
|
||||
var children = $('div#menu ul#navigation #li_'+parent);
|
||||
//if there are other submenus, insert after last of them
|
||||
if (children.length)
|
||||
$(children[children.length-1]).after(li_item);
|
||||
else //instert after parent menu
|
||||
$('div#menu ul#navigation li#li_'+parent).after(li_item);
|
||||
} else { //not a submenu, instert in the end
|
||||
$('div#menu ul#navigation').append(li_item);
|
||||
};
|
||||
|
||||
if (parent){ //this is a subtab
|
||||
$('div#menu li#li_'+tab_name).hide();//hide by default
|
||||
$('div#menu li#li_'+parent+' span').css("display","inline-block");
|
||||
if (children.length) {
|
||||
$('div#menu li#li_'+tab_name).hide();//hide by default
|
||||
$('div#menu li#li_'+parent+' span').css("display","inline-block");
|
||||
}
|
||||
};
|
||||
|
||||
if (showOnTop){
|
||||
|
Loading…
x
Reference in New Issue
Block a user