| author | rougeronj |
| Thu, 18 Jun 2015 16:50:54 +0200 | |
| changeset 487 | 48be7ebb3187 |
| parent 453 | 04b7d46e9d67 |
| 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 |
/* NodeShrinkButton Begin */ |
|
8 |
||
9 |
//var NodeShrinkButton = Renderer.NodeShrinkButton = Utils.inherit(Renderer._NodeButton); |
|
10 |
var NodeShrinkButton = Utils.inherit(NodeButton); |
|
11 |
||
12 |
_(NodeShrinkButton.prototype).extend({ |
|
13 |
_init: function() { |
|
14 |
this.type = "Node-shrink-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 ? -170 : -180; |
|
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 ? -125 : -135; |
| 284 | 18 |
this.imageName = "shrink"; |
19 |
this.text = "Shrink"; |
|
20 |
}, |
|
21 |
mouseup: function() { |
|
22 |
var _newsize = -1 + (this.source_representation.model.get("size") || 0); |
|
23 |
this.source_representation.model.set("size", _newsize); |
|
24 |
this.source_representation.select(); |
|
25 |
this.select(); |
|
26 |
paper.view.draw(); |
|
27 |
} |
|
| 433 | 28 |
}).value(); |
| 284 | 29 |
|
30 |
/* NodeShrinkButton End */ |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
31 |
|
| 284 | 32 |
return NodeShrinkButton; |
33 |
||
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
34 |
}); |