| author | ymh <ymh.work@gmail.com> |
| Thu, 05 Jun 2014 10:48:28 +0200 | |
| changeset 302 | 8eeb52f093e1 |
| parent 293 | fba23fde14ba |
| child 433 | e457ec945e50 |
| 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; |
|
16 |
this.startAngle = 90; |
|
17 |
this.endAngle = 180; |
|
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 |
} |
|
33 |
}); |
|
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 |
}); |