Skip to content

Commit

Permalink
Generalise SVG handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamal Faily committed Jan 17, 2017
1 parent 8098d61 commit 6dca840
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions cairis/web/dist/js/cairis/SVGhandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@

$( document ).ajaxComplete(function() {
$("svg > g > g .node > g > a").on('click', function (event) {
handleNodeClick(event,$(this));
});
});

$( document ).ajaxComplete(function() {
$("svg > g > g .node > a").on('click', function (event) {
handleNodeClick(event,$(this));
});
});

function handleNodeClick(event,objt) {
event.stopImmediatePropagation();
event.preventDefault();
var link = $(this).attr("xlink:href");
var link = objt.attr("xlink:href");

if (self.theVisualModel == 'asset') {
window.assetEnvironment = $('#amenvironmentsbox').val();
Expand Down Expand Up @@ -949,7 +960,7 @@ else if(link.indexOf("obstacles") > -1) {
}
});
}
else if(link.indexOf("usecases") > -1) {
else if(link.indexOf("usecases") > -1) {
forceOpenOptions();
$.ajax({
type: "GET",
Expand Down Expand Up @@ -1010,5 +1021,4 @@ else if(link.indexOf("usecases") > -1) {
}
});
}
});
});
}

0 comments on commit 6dca840

Please sign in to comment.