@hortonstudio/main 1.7.8 → 1.7.10

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.
@@ -477,6 +477,10 @@ function setupMenuButton() {
477
477
  if (!isMenuOpen) return;
478
478
  isMenuOpen = false;
479
479
 
480
+ // Close all open menu dropdowns
481
+ const openDropdownButtons = menu.querySelectorAll('[data-hs-nav="menu-dropdown-btn"][aria-expanded="true"]');
482
+ openDropdownButtons.forEach(button => button.click());
483
+
480
484
  document.body.classList.remove("u-overflow-hidden");
481
485
 
482
486
  const activeMenuButton = Array.from(menuButtons).find(() => menu.contains(document.activeElement));
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version:1.7.8
1
+ // Version:1.7.10
2
2
  const API_NAME = "hsmain";
3
3
 
4
4
  const initializeHsMain = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.7.8",
3
+ "version": "1.7.10",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/utils/slider.js CHANGED
@@ -43,15 +43,17 @@ const initInfiniteCarousel = () => {
43
43
 
44
44
  // Infinite pagination slider
45
45
  const initInfinitePagination = () => {
46
- document.querySelectorAll('[data-hs-slider="pagination-list"]')
47
- .forEach(list => initPaginationInstance(list));
46
+ document.querySelectorAll('[data-hs-slider="pagination"]')
47
+ .forEach(container => {
48
+ const list = container.querySelector('[data-hs-slider="pagination-list"]');
49
+ if (list) initPaginationInstance(list, container);
50
+ });
48
51
  };
49
52
 
50
- const initPaginationInstance = (originalList) => {
53
+ const initPaginationInstance = (originalList, container) => {
51
54
  const wrapper = originalList.parentElement;
52
- if (!wrapper) return;
55
+ if (!wrapper || !container) return;
53
56
 
54
- const container = wrapper.closest('[data-hs-slider*="pagination"]') || wrapper.parentElement;
55
57
  const elements = {
56
58
  nextBtn: container.querySelector('[data-hs-slider="pagination-next"]'),
57
59
  prevBtn: container.querySelector('[data-hs-slider="pagination-previous"]'),
@@ -70,6 +72,7 @@ const initPaginationInstance = (originalList) => {
70
72
  }
71
73
 
72
74
  const config = elements.controls?.getAttribute('data-hs-config') || '';
75
+
73
76
  const configOptions = config.split(', ').map(opt => opt.trim());
74
77
  const isInfiniteMode = configOptions.includes('infinite');
75
78