-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkk-transition.js
99 lines (78 loc) · 2.51 KB
/
kk-transition.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
if (typeof kenzo === 'object') {
var plural_ru = kenzo.plural; // ангажемент, атмр, романтик саунд
var toggle_class = kenzo.toggle_class;
var getRandomInt = kenzo.rand;
var getWindowParams = kenzo.get_window_params;
var getTimestump = kk.ts;
var numderTypo = kk.format.number;
kenzo.plural_ru = kenzo.plural; // СПК
kenzo.generate = kenzo.event;
Element.prototype.getOffset = function() {
kenzo.get_offset(this);
};
kenzo.toggle_class = function(element, classes, classlist, toggle_exist) {
var kenzo = kk,
stop = false;
if (!(element instanceof kenzo._E))
return false;
if (typeof classes === kenzo._s)
classes = [classes];
if (!(classes instanceof kenzo._A))
return false;
if (typeof classlist === kenzo._u)
classlist = classes;
else if (!(classlist instanceof kenzo._A))
return false;
var exist = true;
if (toggle_exist === false)
return kenzo.class(element, classes, classlist)
else
toggle_exist = true;
// Объединение классов
each (classes, function(cls) {
if (typeof cls !== kenzo._s) {
stop = true;
return false;
}
if (classlist.indexOf(cls) < 0)
classlist.push(cls);
if (!element.classList.contains(cls))
exist = false;
});
if (stop) return false;
each (classlist, function(cls) {
if (toggle_exist && exist) {
element.classList.remove(cls);
} else {
if (classes.indexOf(cls) < 0)
element.classList.remove(cls);
else
element.classList.add(cls);
}
});
}
toggle_class = kenzo.toggle_class;
}
kk.get_window_params = function() {
console.warn('get_window_params is DEPRECATED. Use kk.viewport.');
return {
x: kk.viewport.x,
y: kk.viewport.y,
w: kk.viewport.w,
h: kk.viewport.h
};
}
// SPK, Sakura, Evis
kk.is_nodes = function() {
var arg = arguments[0];
if ((kk.is.o(StaticNodeList)) && (arg instanceof StaticNodeList))
if (arg.length > 0)
return true;
else
return false;
if (kk.is.NL(arg))
if (arg.length > 0)
return true;
else
return false;
}