@cocreate/scroll 1.13.0 → 1.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/docs/index.html +395 -365
- package/package.json +6 -10
- package/src/index.js +326 -301
- package/webpack.config.js +65 -90
package/src/index.js
CHANGED
|
@@ -1,320 +1,345 @@
|
|
|
1
|
-
import Observer from
|
|
2
|
-
import Actions from
|
|
1
|
+
import Observer from "@cocreate/observer";
|
|
2
|
+
import Actions from "@cocreate/actions";
|
|
3
3
|
|
|
4
4
|
const CoCreateScroll = {
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
5
|
+
delta: 3,
|
|
6
|
+
observer: null,
|
|
7
|
+
timer: null,
|
|
8
|
+
firedEvents: new Map(),
|
|
9
|
+
|
|
10
|
+
init: function () {
|
|
11
|
+
let elements = document.querySelectorAll(
|
|
12
|
+
`[scroll], [scroll-to], [scrollable-x], [scrollable-y]`
|
|
13
|
+
);
|
|
14
|
+
this.__initIntersectionObserver();
|
|
15
|
+
this.initElements(elements);
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
initElements: function (elements) {
|
|
19
|
+
for (let el of elements) this.initElement(el);
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
initElement: function (element) {
|
|
23
|
+
const self = this;
|
|
24
|
+
const upSize = this.__getSize(element.getAttribute("scroll-up"));
|
|
25
|
+
const downSize = this.__getSize(element.getAttribute("scroll-down"));
|
|
26
|
+
const attrName = element.getAttribute("scroll-attribute") || "class";
|
|
27
|
+
const targetSelector = element.getAttribute("scroll-query");
|
|
28
|
+
const scrollSelector = element.getAttribute("scroll-element");
|
|
29
|
+
const intersectValue = element.getAttribute("scroll-intersect");
|
|
30
|
+
const scrollTo = element.getAttribute("scroll-to");
|
|
31
|
+
|
|
32
|
+
updateScrollableAttributes(element);
|
|
33
|
+
|
|
34
|
+
let values =
|
|
35
|
+
element.getAttribute("scroll") ||
|
|
36
|
+
element.getAttribute("scroll-value");
|
|
37
|
+
if (values || values === "")
|
|
38
|
+
values = values.split(",").map((x) => x.trim());
|
|
39
|
+
|
|
40
|
+
let scrollInfo = {
|
|
41
|
+
attrName: attrName,
|
|
42
|
+
values: values,
|
|
43
|
+
upSize: upSize,
|
|
44
|
+
downSize: downSize,
|
|
45
|
+
scrollTop: element.getAttribute("scroll-top"),
|
|
46
|
+
scrollLimbo: element.getAttribute("scroll-limbo"),
|
|
47
|
+
scrollBottom: element.getAttribute("scroll-bottom"),
|
|
48
|
+
scrolling: element.getAttribute("scrolling"),
|
|
49
|
+
scrollTo
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
let elements = [element];
|
|
53
|
+
if (targetSelector) {
|
|
54
|
+
elements = document.querySelectorAll(targetSelector);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
elements.forEach((el) => {
|
|
58
|
+
el.scrollStatus = { currentPos: 0 };
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// this.__runScrollEvent(element, scrollInfo);
|
|
62
|
+
|
|
63
|
+
let scrollableElements;
|
|
64
|
+
if (scrollSelector)
|
|
65
|
+
scrollableElements = document.querySelectorAll(scrollSelector);
|
|
66
|
+
else if (element.hasAttribute("scroll-element"))
|
|
67
|
+
scrollableElements = [element];
|
|
68
|
+
|
|
69
|
+
if (scrollableElements) {
|
|
70
|
+
for (let scrollableEl of scrollableElements) {
|
|
71
|
+
scrollableEl.addEventListener("scroll", function (event) {
|
|
72
|
+
self._scrollEvent(
|
|
73
|
+
elements,
|
|
74
|
+
element,
|
|
75
|
+
scrollInfo,
|
|
76
|
+
scrollableEl
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
// this.WindowInit = true;
|
|
82
|
+
window.addEventListener("scroll", function (event) {
|
|
83
|
+
self._scrollEvent(elements, element, scrollInfo);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (intersectValue && window.IntersectionObserver && this.observer) {
|
|
88
|
+
this.observer.observe(element);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (scrollTo) {
|
|
92
|
+
this.setScrollPosition(element, scrollTo);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
_scrollEvent: function (elements, element, scrollInfo, scrollableEl) {
|
|
97
|
+
const self = this;
|
|
98
|
+
if (!element.scrollStatus) return;
|
|
99
|
+
let scrollEl = scrollableEl || window;
|
|
100
|
+
if (
|
|
101
|
+
Math.abs(
|
|
102
|
+
scrollEl.scrollTop ||
|
|
103
|
+
scrollEl.scrollY - element.scrollStatus.currentPos
|
|
104
|
+
) <= self.delta
|
|
105
|
+
) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
let timer = null;
|
|
110
|
+
if (timer != null) {
|
|
111
|
+
clearTimeout(timer);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
elements.forEach((el) => {
|
|
115
|
+
self.__setScrolling(el, scrollInfo, false);
|
|
116
|
+
self.__runScrollEvent(el, scrollInfo, scrollableEl);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
timer = setTimeout(function () {
|
|
120
|
+
elements.forEach((el) => {
|
|
121
|
+
self.__setScrolling(el, scrollInfo, true);
|
|
122
|
+
});
|
|
123
|
+
}, 500);
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
setScrollPosition: function (element, scrollTo) {
|
|
127
|
+
if (!scrollTo) return;
|
|
128
|
+
if (scrollTo.includes("top")) {
|
|
129
|
+
element.scrollTop = 0;
|
|
130
|
+
} else if (scrollTo.includes("bottom")) {
|
|
131
|
+
element.scrollTop = element.scrollHeight;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (scrollTo.includes("left")) {
|
|
135
|
+
element.scrollLeft = 0;
|
|
136
|
+
} else if (scrollTo.includes("right")) {
|
|
137
|
+
element.scrollLeft = element.scrollWidth;
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
__initIntersectionObserver: function () {
|
|
142
|
+
const self = this;
|
|
143
|
+
this.observer = new IntersectionObserver((entries) => {
|
|
144
|
+
entries.forEach((entry) => {
|
|
145
|
+
let element = entry.target;
|
|
146
|
+
const attrName =
|
|
147
|
+
element.getAttribute("scroll-attribute") || "class";
|
|
148
|
+
const targetSelector = element.getAttribute("scroll-query");
|
|
149
|
+
const intersectValue = element.getAttribute("scroll-intersect");
|
|
150
|
+
|
|
151
|
+
let targetElements = [element];
|
|
152
|
+
if (targetSelector) {
|
|
153
|
+
targetElements = document.querySelectorAll(targetSelector);
|
|
154
|
+
}
|
|
155
|
+
if (entry.isIntersecting > 0) {
|
|
156
|
+
targetElements.forEach((el) =>
|
|
157
|
+
self.__addAttributeValue(el, attrName, intersectValue)
|
|
158
|
+
);
|
|
159
|
+
} else {
|
|
160
|
+
targetElements.forEach((el) =>
|
|
161
|
+
self.__removeAttrbuteValue(el, attrName, intersectValue)
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
__setScrolling: function (element, info, stopped = false) {
|
|
169
|
+
const { scrolling, attrName } = info;
|
|
170
|
+
if (stopped) {
|
|
171
|
+
this.__removeAttrbuteValue(element, attrName, scrolling);
|
|
172
|
+
} else {
|
|
173
|
+
this.__addAttributeValue(element, attrName, scrolling);
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
__runScrollEvent: function (element, info, scrollableEl) {
|
|
178
|
+
if (!element.scrollStatus) return;
|
|
179
|
+
const currentPos = element.scrollStatus.currentPos;
|
|
180
|
+
let scrollY, scrollHeight, innerHeight;
|
|
181
|
+
if (scrollableEl) {
|
|
182
|
+
scrollY = scrollableEl.scrollTop;
|
|
183
|
+
scrollHeight = scrollableEl.scrollHeight;
|
|
184
|
+
innerHeight = scrollableEl.clientHeight;
|
|
185
|
+
} else {
|
|
186
|
+
scrollY = window.scrollY;
|
|
187
|
+
scrollHeight = document.body.scrollHeight;
|
|
188
|
+
innerHeight = window.innerHeight;
|
|
189
|
+
}
|
|
190
|
+
const {
|
|
191
|
+
upSize,
|
|
192
|
+
downSize,
|
|
193
|
+
attrName,
|
|
194
|
+
values,
|
|
195
|
+
scrollTop,
|
|
196
|
+
scrollBottom,
|
|
197
|
+
scrollLimbo
|
|
198
|
+
} = info;
|
|
199
|
+
|
|
200
|
+
let newTime = new Date().getTime();
|
|
201
|
+
if (!info.datetime || newTime - info.datetime > 200) {
|
|
202
|
+
info["datetime"] = newTime;
|
|
203
|
+
|
|
204
|
+
if (upSize <= currentPos - scrollY) {
|
|
205
|
+
this.__addAttributeValue(element, attrName, values[0]);
|
|
206
|
+
this.__removeAttrbuteValue(element, attrName, values[1]);
|
|
207
|
+
} else if (downSize <= scrollY - currentPos) {
|
|
208
|
+
this.__removeAttrbuteValue(element, attrName, values[0]);
|
|
209
|
+
this.__addAttributeValue(element, attrName, values[1]);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
//. scroll top case
|
|
214
|
+
if (scrollY <= this.delta) {
|
|
215
|
+
this.__removeAttrbuteValue(element, attrName, values[0]);
|
|
216
|
+
this.__removeAttrbuteValue(element, attrName, values[1]);
|
|
217
|
+
|
|
218
|
+
this.__addAttributeValue(element, attrName, scrollTop);
|
|
219
|
+
} else {
|
|
220
|
+
this.__removeAttrbuteValue(element, attrName, scrollTop);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
//. scroll bottom case
|
|
224
|
+
// if ((window.innerHeight + scrollY) >= document.body.scrollHeight) {
|
|
225
|
+
if (innerHeight + scrollY >= scrollHeight) {
|
|
226
|
+
// this.__removeAttrbuteValue(element, attrName, values[0]);
|
|
227
|
+
// this.__removeAttrbuteValue(element, attrName, values[1]);
|
|
228
|
+
|
|
229
|
+
this.__addAttributeValue(element, attrName, scrollBottom);
|
|
230
|
+
} else {
|
|
231
|
+
this.__removeAttrbuteValue(element, attrName, scrollBottom);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// if (scrollY != 0 && (scrollY + window.innerHeight) != document.body.scrollHeight){
|
|
235
|
+
if (scrollY != 0 && scrollY + innerHeight != scrollHeight) {
|
|
236
|
+
this.__addAttributeValue(element, attrName, scrollLimbo);
|
|
237
|
+
} else {
|
|
238
|
+
this.__removeAttrbuteValue(element, attrName, scrollLimbo);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
element.scrollStatus.currentPos = scrollY;
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
__addAttributeValue: function (element, attrName, value) {
|
|
245
|
+
if (!value) return;
|
|
246
|
+
let check = new RegExp("(\\s|^)" + value + "(\\s|$)");
|
|
247
|
+
let attrValue = element.getAttribute(attrName) || "";
|
|
248
|
+
|
|
249
|
+
if (!check.test(attrValue)) {
|
|
250
|
+
if (attrName === "class") attrValue += " " + value;
|
|
251
|
+
else attrValue = value;
|
|
252
|
+
element.setAttribute(attrName, attrValue);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
__removeAttrbuteValue: function (element, attrName, value) {
|
|
257
|
+
if (!value) return;
|
|
258
|
+
let check = new RegExp("(\\s|^)" + value + "(\\s|$)");
|
|
259
|
+
let attrValue = element.getAttribute(attrName) || "";
|
|
260
|
+
|
|
261
|
+
if (check.test(attrValue)) {
|
|
262
|
+
attrValue = attrValue.replace(check, " ").trim();
|
|
263
|
+
element.setAttribute(attrName, attrValue);
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
__getSize: function (attrValue, isWidth) {
|
|
268
|
+
let size = 0;
|
|
269
|
+
if (!attrValue) {
|
|
270
|
+
return 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (attrValue.includes("%")) {
|
|
274
|
+
size = attrValue.replace("%", "").trim();
|
|
275
|
+
size = Number(size) || 0;
|
|
276
|
+
|
|
277
|
+
size = isWidth
|
|
278
|
+
? window.innerWidth / size
|
|
279
|
+
: window.innerHeight / size;
|
|
280
|
+
} else {
|
|
281
|
+
size = attrValue.replace("px", "").trim();
|
|
282
|
+
size = Number(size) || 0;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return size;
|
|
286
|
+
}
|
|
266
287
|
};
|
|
267
288
|
|
|
268
289
|
function updateScrollableAttributes(element) {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
element.setAttribute('scrollable-x', 'false');
|
|
281
|
-
}
|
|
290
|
+
if (element.hasAttribute("scrollable-y")) {
|
|
291
|
+
if (element.scrollWidth > element.clientWidth)
|
|
292
|
+
element.setAttribute("scrollable-y", "true");
|
|
293
|
+
else element.setAttribute("scrollable-y", "false");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (element.hasAttribute("scrollable-x")) {
|
|
297
|
+
if (element.scrollHeight > element.clientHeight)
|
|
298
|
+
element.setAttribute("scrollable-x", "true");
|
|
299
|
+
else element.setAttribute("scrollable-x", "false");
|
|
300
|
+
}
|
|
282
301
|
}
|
|
283
302
|
|
|
284
303
|
Observer.init({
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
304
|
+
name: "CoCreateScrollCreate",
|
|
305
|
+
types: ["addedNodes"],
|
|
306
|
+
selector: "[scroll], [scroll-to], [scrollable-x], [scrollable-y]",
|
|
307
|
+
callback: function (mutation) {
|
|
308
|
+
CoCreateScroll.initElement(mutation.target);
|
|
309
|
+
}
|
|
291
310
|
});
|
|
292
311
|
|
|
293
312
|
Observer.init({
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
313
|
+
name: "CoCreateScrollAttributes",
|
|
314
|
+
types: ["attributes"],
|
|
315
|
+
attributeFilter: ["scroll-to"],
|
|
316
|
+
// target: selector, // blocks mutations when applied
|
|
317
|
+
callback: function (mutation) {
|
|
318
|
+
CoCreateScroll.setScrollPosition(
|
|
319
|
+
mutation.target,
|
|
320
|
+
mutation.target.getAttribute("scroll-to")
|
|
321
|
+
);
|
|
322
|
+
}
|
|
301
323
|
});
|
|
302
324
|
Observer.init({
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
325
|
+
name: "CoCreateScrollAttributes",
|
|
326
|
+
types: ["attributes"],
|
|
327
|
+
attributeFilter: ["scrollable-x", "scrollable-y"],
|
|
328
|
+
// target: selector, // blocks mutations when applied
|
|
329
|
+
callback: function (mutation) {
|
|
330
|
+
if (
|
|
331
|
+
mutation.oldValue !==
|
|
332
|
+
mutation.target.getAttribute(mutation.attributeName)
|
|
333
|
+
)
|
|
334
|
+
updateScrollableAttributes(mutation.target);
|
|
335
|
+
}
|
|
311
336
|
});
|
|
312
337
|
|
|
313
338
|
Actions.init({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
339
|
+
name: "scroll-to",
|
|
340
|
+
callback: (action) => {
|
|
341
|
+
// CoCreateScroll.setScrollPosition(mutation.target)
|
|
342
|
+
}
|
|
318
343
|
});
|
|
319
344
|
|
|
320
345
|
CoCreateScroll.init();
|