@iris.interactive/handcook 2.10.34 → 2.10.36
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
|
@@ -9,7 +9,9 @@ export class HcScrollspy {
|
|
|
9
9
|
document.querySelectorAll(elements).forEach(element => {
|
|
10
10
|
const navElement = document.querySelector(element.dataset.hcScrollspy);
|
|
11
11
|
const shift = element.getAttribute('data-hc-scrollspy-shift') !== null ? parseInt(element.getAttribute('data-hc-scrollspy-shift')) : 0;
|
|
12
|
-
|
|
12
|
+
if (navElement !== null) {
|
|
13
|
+
this.activeItem(navElement, ElementEnum.scrollSmooth, shift);
|
|
14
|
+
}
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
17
|
|
|
@@ -135,6 +135,7 @@ export class HcSlider {
|
|
|
135
135
|
el: '.hc-slider-pagination',
|
|
136
136
|
type: 'bullets',
|
|
137
137
|
clickable: true,
|
|
138
|
+
dynamicBullets: false,
|
|
138
139
|
bulletClass: 'hc-slider-pagination-bullet',
|
|
139
140
|
clickableClass: 'hc-slider-pagination-clickable',
|
|
140
141
|
currentClass: 'hc-slider-pagination-current',
|
|
@@ -193,6 +194,10 @@ export class HcSlider {
|
|
|
193
194
|
// et si les elements n'existent pas déjà
|
|
194
195
|
if (this.options.pagination !== false) {
|
|
195
196
|
|
|
197
|
+
if(items.length >= 8 ){
|
|
198
|
+
this.options.pagination.dynamicBullets = true;
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
const el = this.slider.querySelectorAll(this.options.pagination.el);
|
|
197
202
|
if (el.length === 0) {
|
|
198
203
|
const paginationElement = document.createElement("div");
|
|
@@ -282,4 +287,4 @@ export class HcSlider {
|
|
|
282
287
|
const hc_slider = function (trigger) {
|
|
283
288
|
return new HcSlider(trigger);
|
|
284
289
|
}
|
|
285
|
-
export default hc_slider;
|
|
290
|
+
export default hc_slider;
|