Skip to content

Commit 1a59ad3

Browse files
committed
clean up index.js
1 parent 34b4648 commit 1a59ad3

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

website/modules/asset/ui/src/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ function initBarbaPageTransitions() {
164164
cacheIgnore: false,
165165
preventRunning: true,
166166
timeout: 10000,
167-
168167
transitions: [
169168
{
170169
sync: false,
@@ -193,13 +192,13 @@ function initBarbaPageTransitions() {
193192
});
194193

195194
revealLoaded();
196-
197-
initFilterModal();
195+
if (!window.caseStudiesFilterModal) {
196+
initFilterModal();
197+
}
198198
});
199199
});
200200
}
201201

202-
// Anchor Navigation
203202
function initAnchorNavigation() {
204203
const anchors = document.querySelectorAll('a[href^="#"]');
205204
if (!anchors.length) return;
@@ -219,7 +218,6 @@ function initAnchorNavigation() {
219218

220219
function initMenuToggle() {
221220
apos.util.onReady(() => {
222-
// Menu Open
223221
const menuButton = document.getElementById('nav-icon');
224222
const menu = document.querySelector('[data-menu]');
225223

@@ -230,7 +228,6 @@ function initMenuToggle() {
230228
menuButton.classList.toggle('open');
231229
});
232230

233-
// Close menu when clicking on menu items for non-logged users
234231
const menuLinks = menu.querySelectorAll('a');
235232
menuLinks.forEach((link) => {
236233
link.addEventListener('click', () => {
@@ -243,7 +240,6 @@ function initMenuToggle() {
243240
});
244241
}
245242

246-
// Filter Case Studies modal for Case Studies mobile page
247243
function initFilterModal() {
248244
if (!document.querySelector('.cs_list')) {
249245
return;
@@ -260,7 +256,11 @@ function initFilterModal() {
260256
});
261257
}
262258

263-
document.addEventListener('DOMContentLoaded', initFilterModal);
259+
if (document.readyState === 'loading') {
260+
document.addEventListener('DOMContentLoaded', initFilterModal);
261+
} else {
262+
initFilterModal();
263+
}
264264

265265
export default () => {
266266
initConfiguration();

0 commit comments

Comments
 (0)