From c7edd70b5e5b0f5159c78ce3d924d4e7f60db816 Mon Sep 17 00:00:00 2001 From: Apache <apache@localhost.localdomain> Date: Wed, 16 Mar 2016 15:09:35 +0100 Subject: [PATCH] Bind Click Graph --- client/js/controllers/home/home.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js index f2073e1..9af3ae3 100644 --- a/client/js/controllers/home/home.js +++ b/client/js/controllers/home/home.js @@ -81,7 +81,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I }); //Custom view for this element - joint.shapes.basic.Rect.ElementView = joint.dia.ElementView.extend({ + /*joint.shapes.basic.Rect.ElementView = joint.dia.ElementView.extend({ initialize: function() { _.bindAll(this, 'updateBox'); @@ -98,7 +98,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I this.model.set('select', $(evt.target).val()); }, this)); this.$box.find('select').val(this.model.get('select')); - this.$box.find('.config').on('click', function(){ + this.$box.on('click', function(){ $scope.raiseShowMachineDetailsEvent(); }); // Update the box position whenever the underlying model changes. @@ -126,7 +126,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I this.$box.remove(); } }); - + */ //Read the adjacencyList and build the elements and the links according to it function buildGraphFromAdjacencyList(adjacencyList) { @@ -214,9 +214,10 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I width: $('#graphHolder').width(), //height: test.height, model: graph, - gridSize: 1 + gridSize: 1, + interactive: false }); - + paper.$el.css('pointer-events', 'none'); var cells = buildGraphFromAdjacencyList(vmList); console.log(cells); /*graph.resetCells(cells); @@ -241,8 +242,12 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I paper.setDimensions(test.width, test.height); + $(".Member").bind('click', function() { + console.log("Click"); + $scope.raiseShowMachineDetailsEvent(); + }); + - paper.$el.css('pointer-events', 'none'); }]);