mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Feature #1112: Remove <a> links from menu items.
No need to use them as the effect is achieved with cursor: pointer; CSS property on <li> items directly. Update necessary sunstone files.
This commit is contained in:
parent
51ed17ea0d
commit
3506116a5e
@ -148,7 +148,6 @@ background-image: -moz-linear-gradient(
|
||||
font-size: 11px;
|
||||
text-align: left;
|
||||
padding-left: 40px;
|
||||
|
||||
}
|
||||
|
||||
.navigation li.topTab span.plusIcon,
|
||||
@ -166,8 +165,9 @@ background-image: -moz-linear-gradient(
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
#navigation li a {
|
||||
#navigation li {
|
||||
color: #ffffff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#navigation li:hover, .navigation-active-li {
|
||||
@ -198,10 +198,10 @@ background-image: -moz-linear-gradient(
|
||||
);
|
||||
*/
|
||||
}
|
||||
.navigation-active-li-a {
|
||||
.navigation-active-li {
|
||||
font-weight: bold;
|
||||
}
|
||||
#navigation li:hover a, .navigation-active-li-a {
|
||||
#navigation li:hover {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
|
@ -32,33 +32,34 @@ function popDialogLoading(){
|
||||
}
|
||||
|
||||
function showTab(tabname,highlight_tab){
|
||||
//Since menu items no longer have an <a> element
|
||||
//we no longer expect #tab_id here, but simply tab_id
|
||||
//So safety check - remove # from #tab_id if present to ensure compatibility
|
||||
if (tabname.indexOf('#') == 0)
|
||||
tabname = tabname.substring(1);
|
||||
if (highlight_tab && highlight_tab.indexOf('#') == 0)
|
||||
highlight_tab == highlight.substring(1);
|
||||
|
||||
var activeTab = tabname;
|
||||
|
||||
if (!highlight_tab) highlight_tab = activeTab;
|
||||
|
||||
//clean selected menu
|
||||
$("#navigation li").removeClass("navigation-active-li");
|
||||
$("#navigation li a").removeClass("navigation-active-li-a");
|
||||
$("div#header ul#menutop_ul li").removeClass("navigation-active-li");
|
||||
|
||||
//select tab in left menu
|
||||
var li = $("#navigation li:has(a[href='"+highlight_tab+"'])")
|
||||
var li_a = $("#navigation li a[href='"+highlight_tab+"']")
|
||||
var li = $("#navigation li#li_"+highlight_tab)
|
||||
li.addClass("navigation-active-li");
|
||||
li_a.addClass("navigation-active-li-a");
|
||||
|
||||
//select tab in top menu
|
||||
var top_li = $("div#header ul#menutop_ul li#top_"+highlight_tab.substring(1));
|
||||
var top_li = $("div#header ul#menutop_ul li#top_"+highlight_tab);
|
||||
top_li.addClass("navigation-active-li");
|
||||
|
||||
|
||||
//show tab
|
||||
$(".tab").hide();
|
||||
$(activeTab).show();
|
||||
//~ if (activeTab == '#dashboard') {
|
||||
//~ emptyDashboard();
|
||||
//~ preloadTables();
|
||||
//~ }
|
||||
$('#'+activeTab).show();
|
||||
innerLayout.close("south");
|
||||
}
|
||||
|
||||
@ -71,15 +72,15 @@ function setupTabs(){
|
||||
//leave floor to topTab listener in case of tabs with both classes
|
||||
if ($(this).hasClass('topTab')) return false;
|
||||
|
||||
var tab = $('a',this).attr('href');
|
||||
var tab = $(this).attr('id').substring(3);
|
||||
showTab(tab);
|
||||
return false;
|
||||
});
|
||||
|
||||
topTabs.live("click",function(e){
|
||||
var tab = $('a',this).attr('href'); //This tabs #name
|
||||
var tab = $(this).attr('id').substring(3);
|
||||
//Subtabs have a class with the name of this tab
|
||||
var subtabs = $('div#menu li.'+tab.substr(1));
|
||||
var subtabs = $('div#menu li.'+tab);
|
||||
|
||||
//toggle subtabs only when clicking on the icon or when clicking on an
|
||||
//already selected menu
|
||||
@ -88,9 +89,8 @@ function setupTabs(){
|
||||
//for each subtab, we hide the subsubtabs
|
||||
subtabs.each(function(){
|
||||
//for each subtab, hide its subtabs
|
||||
var subsubtabs = $('a',this);
|
||||
var subsubtabs = $(this).attr('id').substr(3);
|
||||
//subsubtabs class
|
||||
subsubtabs = subsubtabs.attr('href').substr(1);
|
||||
subsubtabs = $('div#menu li.'+subsubtabs);
|
||||
subsubtabs.hide();
|
||||
});
|
||||
|
@ -501,7 +501,7 @@ function clusterSubmenusListeners(){
|
||||
id = id.split('_');
|
||||
id = id[id.length-1];
|
||||
dataTable_hosts.fnFilter(getClusterName(id),3,false,true,false,true);
|
||||
showTab('#hosts_tab',$('a',this).attr('href'));
|
||||
showTab('#hosts_tab',$(this).attr('id').substring(3));
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -510,7 +510,7 @@ function clusterSubmenusListeners(){
|
||||
id = id.split('_');
|
||||
id = id[id.length-1];
|
||||
dataTable_datastores.fnFilter(getClusterName(id),5,false,true,false,true);
|
||||
showTab('#datastores_tab',$('a',this).attr('href'));
|
||||
showTab('#datastores_tab',$(this).attr('id').substring(3));
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -519,7 +519,7 @@ function clusterSubmenusListeners(){
|
||||
id = id.split('_');
|
||||
id = id[id.length-1];
|
||||
dataTable_vNetworks.fnFilter(getClusterName(id),5,false,true,false,true);
|
||||
showTab('#vnets_tab',$('a',this).attr('href'));
|
||||
showTab('#vnets_tab',$(this).attr('id').substring(3));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
@ -225,13 +225,6 @@ function refresh_graphs(){
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
//Dashboard link listener
|
||||
$("#dashboard_tab h3 a",main_tabs_context).live("click", function (){
|
||||
var tab = $(this).attr('href');
|
||||
showTab(tab);
|
||||
return false;
|
||||
});
|
||||
|
||||
emptyDashboard();
|
||||
|
||||
refresh_graphs();
|
||||
|
@ -199,13 +199,6 @@ function refresh_graphs(){
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
//Dashboard link listener
|
||||
$("#dashboard_table h3 a",main_tabs_context).live("click", function (){
|
||||
var tab = $(this).attr('href');
|
||||
showTab(tab);
|
||||
return false;
|
||||
});
|
||||
|
||||
emptyDashboard();
|
||||
|
||||
refresh_graphs();
|
||||
|
@ -373,7 +373,7 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
//Start with the dashboard (supposing we have one).
|
||||
showTab('#dashboard_tab');
|
||||
showTab('dashboard_tab');
|
||||
|
||||
});
|
||||
|
||||
@ -465,7 +465,7 @@ 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+'"><a href="#'+tab_name+'">'+tab_info.title+'<span class="ui-icon ui-icon-circle-plus plusIcon"></span></a></li>');
|
||||
$('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>');
|
||||
|
||||
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