1 |
|
2 |
|
3 |
|
4 | var ActivatorBase = (function () {
|
5 | function ActivatorBase() {
|
6 | }
|
7 | |
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | ActivatorBase.prototype.clickAction = function (ev, activatableEle, startCoord) { };
|
15 | |
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | ActivatorBase.prototype.downAction = function (ev, activatableEle, startCoord) { };
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | ActivatorBase.prototype.upAction = function (ev, activatableEle, startCoord) { };
|
31 | |
32 |
|
33 |
|
34 |
|
35 |
|
36 | ActivatorBase.prototype.clearState = function (animated) { };
|
37 | return ActivatorBase;
|
38 | }());
|
39 | export { ActivatorBase };
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export function isActivatedDisabled(ev, activatableEle) {
|
46 | if (!activatableEle || !activatableEle.parentNode) {
|
47 | return true;
|
48 | }
|
49 | if (!ev) {
|
50 | return false;
|
51 | }
|
52 | if (ev.defaultPrevented) {
|
53 | return true;
|
54 | }
|
55 | var targetEle = ev.target;
|
56 | for (var i = 0; i < 4; i++) {
|
57 | if (!targetEle) {
|
58 | break;
|
59 | }
|
60 | if (targetEle.hasAttribute('disable-activated')) {
|
61 | return true;
|
62 | }
|
63 | targetEle = targetEle.parentElement;
|
64 | }
|
65 | return false;
|
66 | }
|
67 |
|
\ | No newline at end of file |