Skip to content

Commit

Permalink
Load image once - FAT modal - Business modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrafreda committed Sep 18, 2023
1 parent 2177034 commit 28dae63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ class App extends AppHelpers {
let modal = document.querySelector('#' + link.dataset.modalId),
img = modal.querySelector('img'),
imgSrc = img.dataset.src;

modal.open();

if(img.classList.contains('loaded')) return;

img.src = imgSrc;
img.classList.add('loaded');
})
})
}
Expand Down

0 comments on commit 28dae63

Please sign in to comment.