@iris.interactive/handcook 2.10.0 → 2.10.1

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.10.0-blue.svg?cacheSeconds=2592000)
2
+ ![Version](https://img.shields.io/badge/version-2.10.1-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.10.0",
3
+ "version": "2.10.1",
4
4
  "description": "The web cooking by IRIS Interactive",
5
5
  "main": "./public/scripts/index.js",
6
6
  "scripts": {
package/public/index.html CHANGED
@@ -406,7 +406,7 @@
406
406
  <a href="#" class="button-prev-test">Bouton precedent de test</a>
407
407
  </div>
408
408
  <div style="position: relative">
409
- <div data-hc-slider data-hc-slider-arrows data-hc-slider-arrow-prev=".button-prev-test" data-hc-slider-no-swipe="true" data-hc-slider-no-swipe-medium="false">
409
+ <div data-hc-slider data-hc-slider-slides-per-view="1" data-hc-slider-slides-per-view-large="2" data-hc-slider-arrows data-hc-slider-arrow-prev=".button-prev-test" data-hc-slider-no-swipe="true" data-hc-slider-no-swipe-medium="false">
410
410
  <div>
411
411
  <img data-hc-src="https://via.placeholder.com/500x250" alt="" width="500" height="250">
412
412
  </div>
@@ -96,22 +96,29 @@ export class HcSlider {
96
96
  }
97
97
  this.options[config.libKey] = defaultVal;
98
98
  }
99
- this.breakpoints.forEach(breakpoint => {
100
- breakpointOptions[breakpoint.value] = {};
99
+ });
100
+
101
+ this.breakpoints.forEach(breakpoint => {
102
+ let breakpointOptionsConfig = {};
103
+ breakpointKeyConfig.map(config => {
101
104
  let val = this.slider.getAttribute(`data-hc-slider-${config.hcKey}-${breakpoint.name}`);
102
105
  if (val !== null) {
103
- if ( config.callback === 'parseReverseBool' ) {
106
+ if (config.callback === 'parseReverseBool') {
104
107
  val = val !== 'true';
105
108
  }
106
- if ( config.callback === 'parseBool' ) {
109
+ if (config.callback === 'parseBool') {
107
110
  val = val === 'true';
108
111
  }
109
- if ( config.callback === 'parseFloat' ) {
112
+ if (config.callback === 'parseFloat') {
110
113
  val = parseFloat(val);
111
114
  }
112
- breakpointOptions[breakpoint.value][config.libKey] = val;
115
+ breakpointOptionsConfig[config.libKey] = val;
113
116
  }
114
117
  });
118
+
119
+ if ( Object.getOwnPropertyNames(breakpointOptionsConfig).length > 0 ) {
120
+ breakpointOptions[breakpoint.value] = breakpointOptionsConfig;
121
+ }
115
122
  });
116
123
 
117
124
  this.options.breakpoints = breakpointOptions;