From 87b07ee5ef35ca72d84bb1b8f6860aad63cf43c4 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 5 Feb 2016 16:16:41 +0100 Subject: [PATCH] Working the javascript objects for the new maps. --- .../include/javascript/map/MapController.js | 17 +++++++++++------ .../javascript/map/NetworkmapController.js | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index c2cda8d6e5..314ef7463b 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -12,12 +12,20 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +// Constructor var MapController = function(target) { this._target = target; + + console.log(this._id); } +// Atributes +MapController.prototype._id = 333; + + +// Methods MapController.prototype.init_map = function() { - $("#" + this._target + " svg").append( + $(this._target + " svg").append( $("").append( $("") .attr("id", "node_10") @@ -28,8 +36,5 @@ MapController.prototype.init_map = function() { .attr("r", "5") ) ); -}; - -MapController.prototype.test333 = function(aaa) { - console.log(aaa); -} \ No newline at end of file + +}; \ No newline at end of file diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index b3dd77db43..7489308cfc 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -16,5 +16,5 @@ var NetworkmapController = function(target) { MapController.call(this, target); } -NetworkmapController.prototype = new MapController(); +NetworkmapController.prototype = Object.create(MapController.prototype); NetworkmapController.prototype.constructor = NetworkmapController; \ No newline at end of file