Working in the events for the fictional nodes.

This commit is contained in:
mdtrooper 2016-04-04 13:58:54 +02:00
parent a2cbc4d867
commit 304928b2ec
2 changed files with 11 additions and 3 deletions

View File

@ -502,4 +502,5 @@ define("FIT_HEIGH", 4);
define("ITEM_TYPE_AGENT_NETWORKMAP", 0);
define("ITEM_TYPE_MODULE_NETWORKMAP", 1);
define("ITEM_TYPE_EDGE_NETWORKMAP", 2);
define("ITEM_TYPE_FICTIONAL_NODE", 3);
?>

View File

@ -1335,9 +1335,14 @@ MapController.prototype.key_is_pressed = function(key) {
return self._keys_pressed[key];
}
MapController.prototype.events_for_nodes = function() {
MapController.prototype.events_for_nodes = function(id_node) {
var self = this;
var selector = ".node";
if (typeof(id_node) != "undefined") {
selector = "#node_" + id_node;
}
var node_menu = [
{
title: 'Show details',
@ -1385,7 +1390,7 @@ MapController.prototype.events_for_nodes = function() {
}
];
d3.selectAll(".node")
d3.selectAll(selector)
.on("mouseover", function(d) {
self.select_node(d['graph_id'], "over");
})
@ -1427,7 +1432,7 @@ MapController.prototype.events_for_nodes = function() {
.on("drag", dragged)
.on("dragend", dragended);
d3.selectAll(".draggable").call(drag);
d3.selectAll(selector).call(drag);
/**
@ -1943,6 +1948,8 @@ MapController.prototype.add_fictional_node = function() {
self.paint_nodes();
self.paint_items_minimap();
self.events_for_nodes(new_node['graph_id']);
}
MapController.prototype.get_last_graph_id = function() {