| author | ymh <ymh.work@gmail.com> |
| Sat, 25 Apr 2015 04:13:53 +0200 | |
| changeset 433 | e457ec945e50 |
| parent 293 | fba23fde14ba |
| child 434 | 0d5998b32a7c |
| permissions | -rw-r--r-- |
| 284 | 1 |
|
2 |
define(['jquery', 'underscore', 'requtils', 'renderer/baserepresentation'], function ($, _, requtils, BaseRepresentation) { |
|
|
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(); |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
6 |
|
| 284 | 7 |
/* Rkns.Renderer._BaseButton Class */ |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
8 |
|
| 284 | 9 |
/* BaseButton is extended by contextual buttons that appear when hovering on nodes and edges */ |
|
293
fba23fde14ba
Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents:
284
diff
changeset
|
10 |
|
| 284 | 11 |
var _BaseButton = Utils.inherit(BaseRepresentation); |
12 |
||
13 |
_(_BaseButton.prototype).extend({ |
|
14 |
moveTo: function(_pos) { |
|
15 |
this.sector.moveTo(_pos); |
|
16 |
}, |
|
17 |
show: function() { |
|
18 |
this.sector.show(); |
|
19 |
}, |
|
20 |
hide: function() { |
|
21 |
this.sector.hide(); |
|
22 |
}, |
|
23 |
select: function() { |
|
24 |
this.sector.select(); |
|
25 |
}, |
|
26 |
unselect: function(_newTarget) { |
|
27 |
this.sector.unselect(); |
|
28 |
if (!_newTarget || (_newTarget !== this.source_representation && _newTarget.source_representation !== this.source_representation)) { |
|
29 |
this.source_representation.unselect(); |
|
30 |
} |
|
31 |
}, |
|
32 |
destroy: function() { |
|
33 |
this.sector.destroy(); |
|
34 |
} |
|
| 433 | 35 |
}).value(); |
36 |
// }); |
|
| 284 | 37 |
|
38 |
return _BaseButton; |
|
39 |
||
40 |
}); |