| author | rougeronj |
| Thu, 18 Jun 2015 16:50:54 +0200 | |
| changeset 487 | 48be7ebb3187 |
| parent 453 | 04b7d46e9d67 |
| child 622 | 02e3c464223f |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/nodebutton'], function ($, _, requtils, NodeButton) { |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
3 |
'use strict'; |
|
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
4 |
|
| 284 | 5 |
var Utils = requtils.getUtils(); |
6 |
||
7 |
/* NodeLinkButton Begin */ |
|
8 |
||
9 |
//var NodeLinkButton = Renderer.NodeLinkButton = Utils.inherit(Renderer._NodeButton); |
|
10 |
var NodeLinkButton = Utils.inherit(NodeButton); |
|
11 |
||
12 |
_(NodeLinkButton.prototype).extend({ |
|
13 |
_init: function() { |
|
14 |
this.type = "Node-link-button"; |
|
15 |
this.lastSectorInner = 0; |
|
|
487
48be7ebb3187
add hide_nodes option to allow or node the hiding behavior on nodes
rougeronj
parents:
453
diff
changeset
|
16 |
this.startAngle = this.options.hide_nodes ? 135 : 90; |
|
48be7ebb3187
add hide_nodes option to allow or node the hiding behavior on nodes
rougeronj
parents:
453
diff
changeset
|
17 |
this.endAngle = this.options.hide_nodes ? 190 : 180; |
| 284 | 18 |
this.imageName = "link"; |
19 |
this.text = "Link to another node"; |
|
20 |
}, |
|
21 |
mousedown: function(_event, _isTouch) { |
|
22 |
if (this.renderer.isEditable()) { |
|
23 |
var _off = this.renderer.canvas_$.offset(), |
|
24 |
_point = new paper.Point([ |
|
25 |
_event.pageX - _off.left, |
|
26 |
_event.pageY - _off.top |
|
27 |
]); |
|
28 |
this.renderer.click_target = null; |
|
29 |
this.renderer.removeRepresentationsOfType("editor"); |
|
30 |
this.renderer.addTempEdge(this.source_representation, _point); |
|
31 |
} |
|
32 |
} |
|
| 433 | 33 |
}).value(); |
| 284 | 34 |
|
35 |
/* NodeLinkButton End */ |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
36 |
|
| 284 | 37 |
return NodeLinkButton; |
38 |
||
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
39 |
}); |