Skip to content

Commit

Permalink
Disabling links on lines when no target url configured
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsMichelsen committed May 17, 2015
1 parent b0d1c76 commit 2a9538d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions share/frontend/nagvis-js/js/ElementLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ var ElementLine = Element.extend({
this.obj.trigger_obj = oLink;
oLink.setAttribute('id', this.obj.conf.object_id+'-linelink');
oLink.className = 'linelink';
oLink.href = this.obj.conf.url;
oLink.target = this.obj.conf.url_target;
if (this.obj.conf.url) {
oLink.href = this.obj.conf.url;
oLink.target = this.obj.conf.url_target;
} else {
oLink.href = 'javascript:void(0)';
}

this.renderLinkArea();
},
Expand Down Expand Up @@ -379,6 +383,7 @@ var ElementLine = Element.extend({

if (over) {
add_class(this.canvas, 'active');
// move the link area below the cursor to make actions possible
this.link_area.style.display = '';
this.link_area.style.left = (x-5) + 'px';
this.link_area.style.top = (y-5) + 'px';
Expand Down

0 comments on commit 2a9538d

Please sign in to comment.