mirror of
https://github.com/Findus23/RPGnotes.git
synced 2024-09-19 15:43:45 +02:00
run gallery also if page already finished loading
This commit is contained in:
parent
f30be377b1
commit
a98909ec33
2 changed files with 16 additions and 4 deletions
|
@ -1,6 +1,12 @@
|
|||
import {LuminousGallery} from "luminous-lightbox";
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
function initGallery(): void {
|
||||
const galleries = document.querySelectorAll("a.image-viewer");
|
||||
new LuminousGallery(galleries)
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', initGallery)
|
||||
} else {
|
||||
initGallery()
|
||||
}
|
||||
|
|
|
@ -14,11 +14,17 @@ import "./js/gallery"
|
|||
|
||||
const bootstrapModules = [Collapse, Dropdown]
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
function init(): void {
|
||||
if (document.getElementById("id_description_md")) {
|
||||
import ("./js/codemirror").then(value => console.log("loaded"))
|
||||
}
|
||||
if (document.getElementById("graph")) {
|
||||
import ("./js/graph").then(value => console.log("graph loaded"))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', init)
|
||||
} else {
|
||||
init()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue