Skip to content

Commit

Permalink
fix doc load event
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed Jun 2, 2024
1 parent dc4bfe3 commit 2877462
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ const outdir = (process.env.OUT_DIR==null)?"dist":process.env.OUT_DIR
const base = (process.env.PUBLIC_BASE==null)?"":process.env.PUBLIC_BASE
const structuredir = (process.env.STRUCTURE==null)?join(rootdir,".structure"):process.env.STRUCTURE
const contentdir = (process.env.CONTENT==null)?join(rootdir,"content"):process.env.CONTENT
const kroki_server = (process.env.KROKI_SERVER==null)?"https://kroki.io":process.env.CONTENT

const config = {
rootdir: rootdir,
outDir: outdir,
base: base,
content_path: contentdir,
code_path: `${rootdir}/${outdir}/codes`,
kroki_server: "https://kroki.io",
kroki_server: kroki_server,
client_menu:true,
highlighter:{
theme:"dark-plus",
Expand Down
6 changes: 5 additions & 1 deletion src/components/panzoom/panzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ function init_clicks(){
})
}

document.addEventListener('DOMContentLoaded', init_clicks, false);
if(document.readyState == "loading"){
document.addEventListener('DOMContentLoaded', init_clicks, false);
}else{
init_clicks()
}
7 changes: 6 additions & 1 deletion src/components/panzoom/panzoom_common.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ async function init_svgs() {
}

async function init(){
console.log("panzoom_common> init()")
initModalEvents() //needed to be before handling url to open
await init_svgs() //needed before cloning the svg in modal
checkURLModal() //only first match will open, starting with SIDs
}

document.addEventListener('DOMContentLoaded', init, false);
if(document.readyState == "loading"){
document.addEventListener('DOMContentLoaded', init, false);
}else{
init()
}

0 comments on commit 2877462

Please sign in to comment.