Selaa lähdekoodia

Fix view fields not updating correctly

The fields displayed weren't actually changing when changing views.
This also fixes a bug that was attaching tons of
event listeners for nsfw highlighting to the view list
master
Fen Dweller 6 vuotta sitten
vanhempi
commit
4725905788
1 muutettua tiedostoa jossa 12 lisäystä ja 10 poistoa
  1. +12
    -10
      macrovision.js

+ 12
- 10
macrovision.js Näytä tiedosto

@@ -616,16 +616,6 @@ function configViewList(entity, selectedView) {
list.appendChild(option);
});


list.addEventListener("change", e => {
if (list.options[list.selectedIndex].classList.contains("nsfw")) {
list.classList.add("nsfw");
} else {
list.classList.remove("nsfw");
}
})
}

function clearViewList() {
@@ -1840,6 +1830,8 @@ document.addEventListener("DOMContentLoaded", () => {
clickUp(fakeEvent);
});

const viewList = document.querySelector("#entity-view");

document.querySelector("#entity-view").addEventListener("input", e => {
const entity = entities[selected.dataset.key];
entity.view = e.target.value;
@@ -1847,6 +1839,8 @@ document.addEventListener("DOMContentLoaded", () => {
const image = entities[selected.dataset.key].views[e.target.value].image;
selected.querySelector(".entity-image").src = image.source;

configViewOptions(entity, entity.view);

displayAttribution(image.source);

if (image.bottom !== undefined) {
@@ -1859,6 +1853,14 @@ document.addEventListener("DOMContentLoaded", () => {
updateViewOptions(entities[selected.dataset.key], e.target.value);
});

document.querySelector("#entity-view").addEventListener("input", e => {
if (viewList.options[viewList.selectedIndex].classList.contains("nsfw")) {
viewList.classList.add("nsfw");
} else {
viewList.classList.remove("nsfw");
}
})

clearViewList();

document.querySelector("#menu-clear").addEventListener("click", e => {


Loading…
Peruuta
Tallenna