fix pages without a skipAll
This commit is contained in:
parent
bd0fe2983f
commit
88b81681cb
1 changed files with 9 additions and 5 deletions
|
@ -28,7 +28,9 @@ function setImage(id, src, width, height, href, cw, firstLoad) {
|
|||
let caption = document.getElementById('cw');
|
||||
let newCaption;
|
||||
|
||||
if (!skipAll.checked && !opened.has(id) && cw) {
|
||||
let checked = skipAll ? skipAll.checked : false;
|
||||
|
||||
if (!checked && !opened.has(id) && cw) {
|
||||
newCaption = document.getElementById('cw-template')
|
||||
.content.firstElementChild.cloneNode(true);
|
||||
newCaption.querySelector('#cw-text').innerHTML = cw;
|
||||
|
@ -96,10 +98,12 @@ function setup() {
|
|||
button.onchange = e => { if (button.checked) activateButton(button); };
|
||||
}
|
||||
|
||||
skipAll.onchange = e => { if (skipAll.checked) {
|
||||
let caption = document.getElementById('cw');
|
||||
if (caption) { openCW(null, caption, false); }
|
||||
} };
|
||||
if (skipAll) {
|
||||
skipAll.onchange = e => { if (skipAll.checked) {
|
||||
let caption = document.getElementById('cw');
|
||||
if (caption) { openCW(null, caption, false); }
|
||||
} };
|
||||
}
|
||||
|
||||
window.addEventListener('popstate', useFragment);
|
||||
useFragment(true);
|
||||
|
|
Loading…
Reference in a new issue