diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php
index 550c42f3ec..f0828d30bc 100644
--- a/pandora_console/include/class/Map.class.php
+++ b/pandora_console/include/class/Map.class.php
@@ -59,6 +59,7 @@ abstract class Map {
$this->requires_js[] = "include/javascript/jquery.tooltipster.js";
$this->requires_js[] = "include/javascript/jquery.svg.js";
$this->requires_js[] = "include/javascript/jquery.svgdom.js";
+ $this->requires_js[] = "include/javascript/d3-context-menu.js";
if (!$this->loadDB()) {
$this->status = STATUS_ERROR;
@@ -358,6 +359,7 @@ $this->edges = json_decode(
echo "" . "\n";
echo "" . "\n";
echo "" . "\n";
+ echo "" . "\n";
//Tooltips spinner
echo "
";
html_print_image('images/spinner.gif');
diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js
index 7656b5ca81..750e4b0ad3 100644
--- a/pandora_console/include/javascript/map/MapController.js
+++ b/pandora_console/include/javascript/map/MapController.js
@@ -353,6 +353,21 @@ MapController.prototype.move_arrow = function (id_from_any_point_arrow) {
MapController.prototype.init_events = function(principalObject) {
self = this;
+ var node_menu = [
+ {
+ title: 'Ejemplo 1',
+ action: function(elm, d, i) {
+ console.log('Primer elemento!!');
+ }
+ },
+ {
+ title: 'Ejemplo 1',
+ action: function(elm, d, i) {
+ console.log('Segundo elemento!!');
+ }
+ }
+ ]
+
$(this._target + " svg *, " + this._target + " svg")
.off("mousedown", {map: this}, this.click_event);
@@ -376,7 +391,8 @@ MapController.prototype.init_events = function(principalObject) {
if (d3.event.defaultPrevented) return;
self.tooltip_map_create(self, this);
- });
+ })
+ .on("contextmenu", d3.contextMenu(node_menu));
var drag = d3.behavior.drag()
.origin(function(d) { return d; })