| author | durandn |
| Tue, 07 Jun 2016 10:46:20 +0200 | |
| changeset 612 | aa4987fede52 |
| parent 434 | 0d5998b32a7c |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/basebutton'], function ($, _, requtils, BaseButton) { |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
3 |
'use strict'; |
| 396 | 4 |
|
| 284 | 5 |
var Utils = requtils.getUtils(); |
6 |
||
7 |
/* _NodeButton Begin */ |
|
8 |
||
9 |
//var _NodeButton = Renderer._NodeButton = Utils.inherit(Renderer._BaseButton); |
|
10 |
var _NodeButton = Utils.inherit(BaseButton); |
|
11 |
||
12 |
_(_NodeButton.prototype).extend({ |
|
13 |
setSectorSize: function() { |
|
14 |
var sectorInner = this.source_representation.circle_radius; |
|
15 |
if (sectorInner !== this.lastSectorInner) { |
|
16 |
if (this.sector) { |
|
17 |
this.sector.destroy(); |
|
18 |
} |
|
19 |
this.sector = this.renderer.drawSector( |
|
20 |
this, 1 + sectorInner, |
|
21 |
Utils._NODE_BUTTON_WIDTH + sectorInner, |
|
22 |
this.startAngle, |
|
23 |
this.endAngle, |
|
24 |
1, |
|
25 |
this.imageName, |
|
26 |
this.renkan.translate(this.text) |
|
27 |
); |
|
28 |
this.lastSectorInner = sectorInner; |
|
29 |
} |
|
| 396 | 30 |
}, |
31 |
unselect: function() { |
|
32 |
BaseButton.prototype.unselect.apply(this, Array.prototype.slice.call(arguments, 1)); |
|
33 |
if(this.source_representation && this.source_representation.buttons_timeout) { |
|
34 |
clearTimeout(this.source_representation.buttons_timeout); |
|
35 |
this.source_representation.hideButtons(); |
|
36 |
} |
|
37 |
}, |
|
38 |
select: function() { |
|
39 |
if(this.source_representation && this.source_representation.buttons_timeout) { |
|
40 |
clearTimeout(this.source_representation.buttons_timeout); |
|
41 |
} |
|
42 |
this.sector.select(); |
|
43 |
}, |
|
| 433 | 44 |
}).value(); |
|
434
0d5998b32a7c
clean, and finalize lodash migration
ymh <ymh.work@gmail.com>
parents:
433
diff
changeset
|
45 |
|
| 284 | 46 |
|
47 |
/* _NodeButton End */ |
|
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
48 |
|
| 284 | 49 |
return _NodeButton; |
50 |
||
51 |
}); |