@@ 15,7 15,6 @@ let state = {
rendering: {
dirty: true,
gridDirty: true,
- buttonsDirty: true,
},
};
@@ 48,19 47,6 @@ function stateUpdated() {
can.style.cursor = "auto";
}
state.rendering.dirty = true;
-
- ACTIONS.forEach(action => {
- if (action.actionType === "toggle") {
- const btn = document.getElementById("action-" + action.name);
- if (btn) {
- if (state[action.stateBool]) {
- btn.classList.add("on");
- } else {
- btn.classList.remove("on");
- }
- }
- }
- });
}
function themeColor(id) {
@@ 446,7 432,14 @@ function execAction(id, slow) {
} else if (action.actionType === "toggle") {
state[action.stateBool] = !state[action.stateBool];
state.rendering.gridDirty = true;
- state.rendering.buttonsDirty = true;
+ const btn = document.getElementById("action-" + action.name);
+ if (btn) {
+ if (state[action.stateBool]) {
+ btn.classList.add("on");
+ } else {
+ btn.classList.remove("on");
+ }
+ }
}
stateUpdated();
}