refactor(js): use DOMContentLoaded instead of ds:page:update

This commit is contained in:
Paul Chavard 2022-04-21 18:48:34 +02:00
parent 38e152f755
commit 0dac59bffc
4 changed files with 5 additions and 5 deletions

View file

@ -54,5 +54,5 @@ function saveMessageContent() {
}
}
addEventListener('ds:page:update', scrollMessagerie);
addEventListener('ds:page:update', saveMessageContent);
addEventListener('DOMContentLoaded', scrollMessagerie);
addEventListener('DOMContentLoaded', saveMessageContent);

View file

@ -14,7 +14,7 @@ function expandProcedureDescription() {
descBody.classList.remove('read-more-collapsed');
}
addEventListener('ds:page:update', updateReadMoreVisibility);
addEventListener('DOMContentLoaded', updateReadMoreVisibility);
addEventListener('resize', updateReadMoreVisibility);
delegate('click', '.read-more-button', expandProcedureDescription);

View file

@ -101,7 +101,7 @@ class ButtonExpand {
if (document.querySelector('#contact-form')) {
window.addEventListener(
'ds:page:update',
'DOMContentLoaded',
function () {
var buttons = document.querySelectorAll(
'button[aria-expanded][aria-controls], button.button-without-hint'

View file

@ -20,7 +20,7 @@ function init() {
}
}
addEventListener('ds:page:update', init);
addEventListener('DOMContentLoaded', init);
function toggleElement(event) {
event.preventDefault();