}
e.preventDefault();
e.stopPropagation();
+ var selectLink = false;
+ var deselectAll = false;
if (!$(this).hasClass('selected')) {
if (!e.ctrlKey) {
- $this.deselectAllLinks();
+ deselectAll = true;
}
+ selectLink = true;
+ } else {
+ if (e.ctrlKey) {
+ selectLink = false;
+ } else {
+ selectLink = true;
+ deselectAll = true;
+ }
+ }
+ if (deselectAll) {
+ $this.deselectAllLinks();
+ }
+ if (selectLink) {
$this.selectLink($(this));
+ $this.startDragLink();
+ } else {
+ $this.deselectLink($(this));
}
- $this.startDragLink();
+
return false;
});