Bind Click Graph

This commit is contained in:
Apache 2016-03-16 15:09:35 +01:00
parent fea574ac18
commit c7edd70b5e

View file

@ -81,7 +81,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
}); });
//Custom view for this element //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() { initialize: function() {
_.bindAll(this, 'updateBox'); _.bindAll(this, 'updateBox');
@ -98,7 +98,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
this.model.set('select', $(evt.target).val()); this.model.set('select', $(evt.target).val());
}, this)); }, this));
this.$box.find('select').val(this.model.get('select')); this.$box.find('select').val(this.model.get('select'));
this.$box.find('.config').on('click', function(){ this.$box.on('click', function(){
$scope.raiseShowMachineDetailsEvent(); $scope.raiseShowMachineDetailsEvent();
}); });
// Update the box position whenever the underlying model changes. // Update the box position whenever the underlying model changes.
@ -126,7 +126,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
this.$box.remove(); this.$box.remove();
} }
}); });
*/
//Read the adjacencyList and build the elements and the links according to it //Read the adjacencyList and build the elements and the links according to it
function buildGraphFromAdjacencyList(adjacencyList) { function buildGraphFromAdjacencyList(adjacencyList) {
@ -214,9 +214,10 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
width: $('#graphHolder').width(), width: $('#graphHolder').width(),
//height: test.height, //height: test.height,
model: graph, model: graph,
gridSize: 1 gridSize: 1,
interactive: false
}); });
paper.$el.css('pointer-events', 'none');
var cells = buildGraphFromAdjacencyList(vmList); var cells = buildGraphFromAdjacencyList(vmList);
console.log(cells); console.log(cells);
/*graph.resetCells(cells); /*graph.resetCells(cells);
@ -241,8 +242,12 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I
paper.setDimensions(test.width, test.height); paper.setDimensions(test.width, test.height);
$(".Member").bind('click', function() {
console.log("Click");
$scope.raiseShowMachineDetailsEvent();
});
paper.$el.css('pointer-events', 'none');
}]); }]);