mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Sunstone: Append submenus after parents menu.
Allows more freedom in the loading order of plugins. Submenus will always be added after parent menu item, or after parents submenus items (so it keeps order).
This commit is contained in:
parent
fd4f8c87e0
commit
8d68721a59
@ -53,6 +53,11 @@
|
||||
:ALL: true
|
||||
:user:
|
||||
:group:
|
||||
- plugins/clusters-tab.js:
|
||||
:ALL: false
|
||||
:user:
|
||||
:group:
|
||||
oneadmin: true
|
||||
- plugins/hosts-tab.js:
|
||||
:ALL: true
|
||||
:user:
|
||||
@ -65,8 +70,3 @@
|
||||
:ALL: true
|
||||
:user:
|
||||
:group:
|
||||
- plugins/clusters-tab.js:
|
||||
:ALL: false
|
||||
:user:
|
||||
:group:
|
||||
oneadmin: true
|
||||
|
@ -465,7 +465,19 @@ function insertTab(tab_name){
|
||||
|
||||
$('div#'+tab_name,main_tabs_context).html(tab_info.content);
|
||||
|
||||
$('div#menu ul#navigation').append('<li id="li_'+tab_name+'" class="'+tabClass+' '+parent+'">'+tab_info.title+'<span class="ui-icon ui-icon-circle-plus plusIcon"></span></li>');
|
||||
var li_item = '<li id="li_'+tab_name+'" class="'+tabClass+' '+parent+'">'+tab_info.title+'<span class="ui-icon ui-icon-circle-plus plusIcon"></span></li>';
|
||||
|
||||
//if this is a submenu...
|
||||
if (parent.length) {
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user