@iris.interactive/handcook 2.6.18 → 2.6.19
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
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import ElementEnum from "../../enumerators/element.enum";
|
|
17
17
|
import Swiper from "swiper/bundle";
|
|
18
18
|
import "swiper/css";
|
|
19
|
-
import "swiper/css/effect-fade";
|
|
20
19
|
|
|
21
20
|
export class HcSlider {
|
|
22
21
|
|
|
@@ -104,9 +103,11 @@ export class HcSlider {
|
|
|
104
103
|
}
|
|
105
104
|
if (this.slider.hasAttribute('data-hc-slider-arrows')) {
|
|
106
105
|
const suffix = this.slider.getAttribute('data-hc-slider-arrows');
|
|
106
|
+
const prevElement = this.slider.hasAttribute('data-hc-slider-arrow-prev') ? this.slider.getAttribute('data-hc-slider-arrow-prev') : `.hc-slider-button-prev${suffix}`;
|
|
107
|
+
const nextElement = this.slider.hasAttribute('data-hc-slider-arrow-next') ? this.slider.getAttribute('data-hc-slider-arrow-next') : `.hc-slider-button-next${suffix}`;
|
|
107
108
|
this.options['navigation'] = {
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
prevEl: prevElement,
|
|
110
|
+
nextEl: nextElement,
|
|
110
111
|
disabledClass: `hc-slider-button-disabled${suffix}`,
|
|
111
112
|
hiddenClass: `hc-slider-button-hidden${suffix}`
|
|
112
113
|
};
|
|
@@ -150,18 +151,22 @@ export class HcSlider {
|
|
|
150
151
|
}
|
|
151
152
|
if (this.options.navigation !== false) {
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
if (!this.slider.hasAttribute('data-hc-slider-arrow-prev')) {
|
|
155
|
+
const prevEl = this.slider.querySelectorAll(this.options.navigation.prevEl);
|
|
156
|
+
if (prevEl.length === 0) {
|
|
157
|
+
const buttonPrev = document.createElement("div");
|
|
158
|
+
buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
|
|
159
|
+
this.slider.appendChild(buttonPrev);
|
|
160
|
+
}
|
|
158
161
|
}
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
if (!this.slider.hasAttribute('data-hc-slider-arrow-next')) {
|
|
164
|
+
const nextEl = this.slider.querySelectorAll(this.options.navigation.nextEl);
|
|
165
|
+
if (nextEl.length === 0) {
|
|
166
|
+
const buttonNext = document.createElement("div");
|
|
167
|
+
buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
|
|
168
|
+
this.slider.appendChild(buttonNext);
|
|
169
|
+
}
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
}
|