@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
- ![Version](https://img.shields.io/badge/version-2.6.18-blue.svg?cacheSeconds=2592000)
2
+ ![Version](https://img.shields.io/badge/version-2.6.19-blue.svg?cacheSeconds=2592000)
3
3
  ![Prerequisite](https://img.shields.io/badge/node-%3E%3D%2012.14.0-blue.svg)
4
4
  [![License: UNLICENSED](https://img.shields.io/badge/License-UNLICENSED-yellow.svg)](#)
5
5
  [![Twitter: captain\_iris](https://img.shields.io/twitter/follow/captain\_iris.svg?style=social)](https://twitter.com/captain\_iris)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iris.interactive/handcook",
3
- "version": "2.6.18",
3
+ "version": "2.6.19",
4
4
  "description": "The web cooking by IRIS Interactive",
5
5
  "main": "./public/scripts/index.js",
6
6
  "scripts": {
@@ -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
- nextEl: `.hc-slider-button-next${suffix}`,
109
- prevEl: `.hc-slider-button-prev${suffix}`,
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
- const prevEl = this.slider.querySelectorAll(this.options.navigation.prevEl);
154
- if (prevEl.length === 0) {
155
- const buttonPrev = document.createElement("div");
156
- buttonPrev.classList.add(this.options.navigation.prevEl.substr(1));
157
- this.slider.appendChild(buttonPrev);
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
- const nextEl = this.slider.querySelectorAll(this.options.navigation.nextEl);
161
- if (nextEl.length === 0) {
162
- const buttonNext = document.createElement("div");
163
- buttonNext.classList.add(this.options.navigation.nextEl.substr(1));
164
- this.slider.appendChild(buttonNext);
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
  }
@@ -413,4 +413,4 @@ $c-warning: #ff890e;
413
413
  / ================================================== */
414
414
  $c-easy: #9ccc65;
415
415
  $c-medium: #ff890e;
416
- $c-hard: #ef5350;
416
+ $c-hard: #ef5350;