Merge branch 'ent-8307-Supernet-map-Desplegar-elementos' into 'develop'
Ent 8307 supernet map desplegar elementos See merge request artica/pandorafms!4559
This commit is contained in:
commit
e7e8920783
|
@ -3409,6 +3409,15 @@ class NetworkMap
|
|||
$output .= '<link rel="stylesheet" type="text/css" href="'.ui_get_full_url(
|
||||
'include/styles/tooltipster.bundle.min.css'
|
||||
).'" />'."\n";
|
||||
ui_require_css_file('jquery.contextMenu', 'include/styles/js/');
|
||||
$output .= '<script type="text/javascript" src="';
|
||||
$output .= ui_get_full_url(
|
||||
'include/javascript/jquery.contextMenu.js',
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
$output .= '" charset="utf-8"></script>';
|
||||
|
||||
$output .= '<div id="simple_map" data-id="'.$this->idMap.'" ';
|
||||
$output .= 'class="border_1px_dd" style="';
|
||||
|
|
|
@ -381,6 +381,52 @@ SimpleMapController.prototype.paint_nodes = function() {
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (
|
||||
typeof node["type_net"] !== "undefined" &&
|
||||
node["type_net"] === "supernet"
|
||||
) {
|
||||
var items_list = {};
|
||||
items_list["details"] = {
|
||||
name: "Show/hide subnets",
|
||||
icon: "show",
|
||||
disabled: false,
|
||||
callback: function(key, options) {
|
||||
self.nodes.forEach(function(subnode) {
|
||||
if (
|
||||
subnode.id != node["id"] &&
|
||||
subnode.id_parent != null &&
|
||||
subnode.id_parent == node["id"]
|
||||
) {
|
||||
if ($("#node_" + subnode.id).css("display") == "none") {
|
||||
$("#node_" + subnode.id).show();
|
||||
} else {
|
||||
$("#node_" + subnode.id).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
self.arrows.forEach(function(arrow) {
|
||||
if (arrow.source == node["id"] || arrow.target == node["id"]) {
|
||||
if (
|
||||
$("#arrow_" + arrow.source + "_" + arrow.target).css(
|
||||
"display"
|
||||
) == "none"
|
||||
) {
|
||||
$("#arrow_" + arrow.source + "_" + arrow.target).show();
|
||||
} else {
|
||||
$("#arrow_" + arrow.source + "_" + arrow.target).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$.contextMenu({
|
||||
selector: "#node_" + node["id"],
|
||||
items: items_list
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -416,6 +462,9 @@ SimpleMapController.prototype.paint_arrows = function() {
|
|||
})
|
||||
.attr("y2", function(d) {
|
||||
return self.center_y + self.getSecondPoint(d["dest"], "y");
|
||||
})
|
||||
.attr("id", function(d) {
|
||||
return "arrow_" + d["source"] + "_" + d["target"];
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
.context-menu-item.icon {
|
||||
min-height: 18px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: 4px 2px;
|
||||
background-position: 4px center;
|
||||
}
|
||||
.context-menu-item.icon-edit {
|
||||
background-image: url(../../../images/page_white_edit.png);
|
||||
|
@ -163,6 +163,9 @@
|
|||
.context-menu-item.icon-interface_link_cancel {
|
||||
background-image: url(../../../images/link_abortar.png);
|
||||
}
|
||||
.context-menu-item.icon-show {
|
||||
background-image: url(../../../images/eye_show.png);
|
||||
}
|
||||
|
||||
/* vertically align inside labels */
|
||||
.context-menu-input > label > * {
|
||||
|
|
Loading…
Reference in New Issue