-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
97 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
templates/frontOffice/modern/components/smarty/Cart/Cart.js
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
templates/frontOffice/modern/components/smarty/Cart/Cart.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export default () => { | ||
for (const form of document.querySelectorAll('.Cart-form')) { | ||
form | ||
?.querySelector('select[name=quantity]') | ||
?.addEventListener('change', function () { | ||
(form as HTMLFormElement).submit(); | ||
}); | ||
form | ||
?.querySelector('input[name=quantity]') | ||
?.addEventListener('change', function () { | ||
(form as HTMLFormElement).submit(); | ||
}); | ||
form | ||
?.querySelector('.Button-change-country') | ||
?.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
(form as HTMLFormElement).submit(); | ||
}); | ||
} | ||
}; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
30 changes: 0 additions & 30 deletions
30
templates/frontOffice/modern/components/smarty/StateSelect/StateSelect.js
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
templates/frontOffice/modern/components/smarty/StateSelect/StateSelect.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export default function StateSelect() { | ||
let originalStateInput = document.querySelector('[name$="[state]"]'); | ||
|
||
const stateInputCopy = originalStateInput?.cloneNode(true); | ||
|
||
document.addEventListener( | ||
'change', | ||
(e) => { | ||
if ((e.target as HTMLInputElement)?.matches('[name$="[country]"]')) { | ||
const countryId = (e.target as HTMLInputElement).value; | ||
const stateInput = document.querySelector('[name$="[state]"]'); | ||
const validStates = (stateInputCopy as Document)?.querySelectorAll( | ||
`[data-country="${countryId}"]` | ||
); | ||
|
||
if (validStates.length) { | ||
const stateInput = document.querySelector('[name$="[state]"]'); | ||
if (stateInput) { | ||
stateInput.innerHTML = ''; | ||
} | ||
stateInput?.closest('.StateSelect')?.classList.remove('hidden'); | ||
for (const state of validStates) { | ||
stateInput?.appendChild(state); | ||
} | ||
} else { | ||
stateInput?.closest('.StateSelect')?.classList.add('hidden'); | ||
} | ||
} | ||
}, | ||
false | ||
); | ||
} |
17 changes: 0 additions & 17 deletions
17
templates/frontOffice/modern/components/smarty/StratSeo/StratSeo.js
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
templates/frontOffice/modern/components/smarty/StratSeo/StratSeo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export default function StratSeo() { | ||
const observer = new IntersectionObserver( | ||
(observables) => { | ||
observables.forEach((observable) => { | ||
if (observable.intersectionRatio > 0.4) { | ||
observable.target.classList.remove('is-hide'); | ||
observer.unobserve(observable.target); | ||
} | ||
}); | ||
}, | ||
{ | ||
threshold: [0.4] | ||
} | ||
); | ||
|
||
const strat = document.getElementById('StratSeo'); | ||
|
||
observer.observe(strat as Element); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters