mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 03:19:05 +02:00
Fixed bug when deleting nodes in network maps
This commit is contained in:
parent
73a512a08b
commit
d392978a70
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user