@iris.interactive/handcook 2.10.36 → 4.0.0
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/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Welcome to HandCook 👨🍳
|
|
2
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/package.json
CHANGED
|
@@ -39,18 +39,21 @@ export class HcSlider {
|
|
|
39
39
|
// Options
|
|
40
40
|
options = {};
|
|
41
41
|
|
|
42
|
+
// Events
|
|
43
|
+
initEvent;
|
|
44
|
+
|
|
42
45
|
/**
|
|
43
46
|
* @param elements
|
|
44
47
|
*/
|
|
45
48
|
constructor(elements = ElementEnum.slider) {
|
|
46
|
-
this.initOptions();
|
|
47
49
|
document.querySelectorAll(elements).forEach(element => {
|
|
50
|
+
this.initEvent = new Event("init.hc.slider");
|
|
51
|
+
this.initOptions();
|
|
48
52
|
this.slider = element;
|
|
49
53
|
this.setOptions();
|
|
50
54
|
this.buildDom();
|
|
51
55
|
const instance = new Swiper(element, this.options);
|
|
52
56
|
this.instances.push(instance);
|
|
53
|
-
this.initOptions();
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
|
|
@@ -266,6 +269,8 @@ export class HcSlider {
|
|
|
266
269
|
if (swiper.isLocked) {
|
|
267
270
|
swiper.$el.addClass('hc-slider-lock');
|
|
268
271
|
}
|
|
272
|
+
|
|
273
|
+
this.slider.dispatchEvent(this.initEvent);
|
|
269
274
|
},
|
|
270
275
|
slideChangeTransitionEnd: (swiper) => {
|
|
271
276
|
|