From 3da818c289ed961f77757a63b65ffc66fed0e195 Mon Sep 17 00:00:00 2001 From: Madison Scott-Clary Date: Sun, 1 Mar 2020 23:22:46 -0800 Subject: [PATCH] Fix load flash --- static/assets/js/carousel.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/static/assets/js/carousel.js b/static/assets/js/carousel.js index 483b94a..6f8e8ee 100644 --- a/static/assets/js/carousel.js +++ b/static/assets/js/carousel.js @@ -25,18 +25,14 @@ function load() { // Add a listener for the location changing if window width supports it. if (window.innerWidth >= 960) { window.addEventListener('popstate', switchTab); - document.querySelector('.carousel nav').style.display = 'block'; } else { window.removeEventListener('popstate', switchTab); - document.querySelector('.carousel nav').style.display = 'none'; } } // If we enter the page with a hash, select the current item. -window.addEventListener('load', () => { - switchTab({preventDefault: () => {}}); - load(); -}); +switchTab({preventDefault: () => {}}); +load(); window.addEventListener('resize', load); // If we enter the page with no hash, select home.