Working the javascript objects for the new maps.

This commit is contained in:
mdtrooper 2016-02-05 16:16:41 +01:00
parent 9307a6e77e
commit 87b07ee5ef
2 changed files with 12 additions and 7 deletions

View File

@ -12,12 +12,20 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Constructor
var MapController = function(target) { var MapController = function(target) {
this._target = target; this._target = target;
console.log(this._id);
} }
// Atributes
MapController.prototype._id = 333;
// Methods
MapController.prototype.init_map = function() { MapController.prototype.init_map = function() {
$("#" + this._target + " svg").append( $(this._target + " svg").append(
$("<g>").append( $("<g>").append(
$("<circle>") $("<circle>")
.attr("id", "node_10") .attr("id", "node_10")
@ -28,8 +36,5 @@ MapController.prototype.init_map = function() {
.attr("r", "5") .attr("r", "5")
) )
); );
};
MapController.prototype.test333 = function(aaa) { };
console.log(aaa);
}

View File

@ -16,5 +16,5 @@ var NetworkmapController = function(target) {
MapController.call(this, target); MapController.call(this, target);
} }
NetworkmapController.prototype = new MapController(); NetworkmapController.prototype = Object.create(MapController.prototype);
NetworkmapController.prototype.constructor = NetworkmapController; NetworkmapController.prototype.constructor = NetworkmapController;