1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

B #3614: hide create button when no have option (#3860)

Signed-off-by: Jorge Lobo <jlobo@opennebula.systems>
This commit is contained in:
Jorge Lobo 2019-10-18 13:00:11 +02:00 committed by Tino Vázquez
parent 1dcff46f86
commit 861af3fa72
2 changed files with 21 additions and 1 deletions

View File

@ -649,11 +649,24 @@ define(function(require) {
_setupButtons();
};
var hideToggleButton = function(elements){
if(elements && elements.parents("ul.dropdown-pane.menu")){
var parent = elements.parents("ul.dropdown-pane.menu");
var id = parent.attr("id");
var anchors = parent.find("a.action_button:visible");
var button = parent.siblings("button[data-toggle|='"+id+"']");
if(anchors.length === 0){
button.addClass("superHide");
}else{
button.removeClass("superHide");
}
}
}
var _showRighList = function(tabName) {
var tab = $("#" + tabName);
$(".tab").hide();
tab.show();
$(".sunstone-info", tab).hide();
$(".sunstone-form", tab).hide();
$(".sunstone-list", tab).fadeIn();
@ -661,6 +674,8 @@ define(function(require) {
$(".only-sunstone-form", tab).hide();
$(".only-sunstone-list", tab).fadeIn();
$(".action_blocks", tab).removeClass("large-12").addClass("large-9");
hideToggleButton($(".only-sunstone-list", tab));
};
var _showRighInfo = function(tabName) {
@ -675,6 +690,8 @@ define(function(require) {
$(".only-sunstone-form", tab).hide();
$(".only-sunstone-info", tab).fadeIn();
$(".action_blocks", tab).removeClass("large-9").addClass("large-12");
hideToggleButton($(".only-sunstone-list", tab));
};
var _showTab = function(tabName) {

View File

@ -238,3 +238,6 @@ meter {
width: 4em;
}
.superHide{
display: none !important;
}