Merge branch 'ent-5006-Bug-al-eliminar-un-nodo-de-un-mapa-de-red-y-mover-otro-elemento' into 'develop'

Ent 5006 bug al eliminar un nodo de un mapa de red y mover otro elemento

See merge request artica/pandorafms!2907
This commit is contained in:
vgilc 2019-12-10 11:30:28 +01:00
commit 1b2d4e233a
1 changed files with 9 additions and 6 deletions

View File

@ -792,8 +792,8 @@ function edit_node(data_node, dblClick) {
var id_networkmap_lenght = networkmap_id.toString().length;
var id_node_length = id.length - id_networkmap_lenght;
id = id.substring(0, id_node_length);
var node_selected = graph.nodes[id];
var index_node = $.inArray(data_node, graph.nodes);
var node_selected = graph.nodes[index_node];
var selected_links = get_relations(node_selected);
$(
@ -2868,10 +2868,13 @@ function init_drag_and_drop() {
var selection = d3.selectAll(".node_selected");
selection.each(function(d) {
graph.nodes[d.id].x = d.x + delta[0];
graph.nodes[d.id].y = d.y + delta[1];
graph.nodes[d.id].px = d.px + delta[0];
graph.nodes[d.id].py = d.py + delta[1];
// We search the position of this node in the array (index).
// This is to avoid errors when deleting nodes (id doesn't match index).
var index_node = $.inArray(d, graph.nodes);
graph.nodes[index_node].x = d.x + delta[0];
graph.nodes[index_node].y = d.y + delta[1];
graph.nodes[index_node].px = d.px + delta[0];
graph.nodes[index_node].py = d.py + delta[1];
});
draw_elements_graph();