remove some unused cruft
This commit is contained in:
parent
8dcc603ade
commit
db83137243
1 changed files with 7 additions and 11 deletions
|
@ -24,7 +24,7 @@ function addCWListeners(id, caption) {
|
|||
}
|
||||
}
|
||||
|
||||
function setImage(id, src, width, height, href, cw, firstLoad) {
|
||||
function setImage(id, src, href, cw) {
|
||||
let caption = document.getElementById('cw');
|
||||
let newCaption;
|
||||
|
||||
|
@ -45,17 +45,13 @@ function setImage(id, src, width, height, href, cw, firstLoad) {
|
|||
mainlink.tabIndex = -1;
|
||||
}
|
||||
|
||||
mainimg.src = src;
|
||||
mainfig.dataset.width = width;
|
||||
mainfig.dataset.height = height;
|
||||
mainlink.href = href;
|
||||
mainimg.src = src;
|
||||
mainlink.href = href;
|
||||
}
|
||||
|
||||
function activateButton(button, doPush = true, firstLoad = false) {
|
||||
function activateButton(button, doPush = true) {
|
||||
setImage(button.id, button.value,
|
||||
button.dataset.width, button.dataset.height,
|
||||
button.dataset.link, button.dataset.warning,
|
||||
firstLoad);
|
||||
button.dataset.link, button.dataset.warning);
|
||||
|
||||
if (doPush) history.pushState(null, '', '#' + button.id);
|
||||
}
|
||||
|
@ -74,7 +70,7 @@ function useFragment(firstLoad = false) {
|
|||
if (button) {
|
||||
id = button.id;
|
||||
button.checked = true;
|
||||
activateButton(button, false, firstLoad);
|
||||
activateButton(button, false);
|
||||
}
|
||||
|
||||
if (firstLoad) addCWListeners(id, document.getElementById('cw'));
|
||||
|
@ -105,7 +101,7 @@ function setup() {
|
|||
} };
|
||||
}
|
||||
|
||||
window.addEventListener('popstate', useFragment);
|
||||
window.addEventListener('popstate', e => useFragment());
|
||||
useFragment(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue