diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 706a607c10..1de1b66130 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -257,7 +257,11 @@ MapController.prototype.get_node = function(id_graph) { $.each(nodes, function(i, node) { if (node['graph_id'] == id_graph) { + + node['index_node'] = i; + return_node = node; + return false; } }); diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index 4af0c95f4c..479dd73f04 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -2113,19 +2113,28 @@ NetworkmapController.prototype.editNode = function(target) { * This function aplies the new data to the node */ NetworkmapController.prototype.apply_edit_node = function(data_graph_id) { + var self = this; + var node_id = data_graph_id; var new_label = $("#edit_node_dialog_" + node_id + " input[id='text-label']").val(); var new_shape = $("#edit_node_dialog_" + node_id + " select[id='shape']").val(); - $('#' + node_id + " text").text(new_label); + var id_graph = node_id.replace(/node_/, ""); - switch (new_shape) { - case 'circle': - break; - case 'rhombus': - break; - case 'square': - break; - } + var node = self.get_node(id_graph); + + node['title'] = new_label; + node['shape'] = new_shape; + + nodes[node['index_node']] = node; + + d3.selectAll(self._target + " #" + node_id + " *") + .remove(); + + self.paint_node(d3.select(self._target + " #" + node_id).node(), node); + + self.move_arrow(id_graph); + + $("#edit_node_dialog_" + node_id).dialog("close"); }