()
| 25 | }) |
| 26 | |
| 27 | function ModifierToggle() { |
| 28 | let overlays = document.querySelector("#editor-inputs-tags-list").querySelectorAll(".modifier-card-overlay") |
| 29 | overlays.forEach((i) => { |
| 30 | i.oncontextmenu = (e) => { |
| 31 | e.preventDefault() |
| 32 | |
| 33 | if (i.parentElement.classList.contains("modifier-toggle-inactive")) { |
| 34 | i.parentElement.classList.remove("modifier-toggle-inactive") |
| 35 | } else { |
| 36 | i.parentElement.classList.add("modifier-toggle-inactive") |
| 37 | } |
| 38 | // refresh activeTags |
| 39 | let modifierName = i.parentElement |
| 40 | .getElementsByClassName("modifier-card-label")[0] |
| 41 | .getElementsByTagName("p")[0].dataset.fullName |
| 42 | activeTags = activeTags.map((obj) => { |
| 43 | if (trimModifiers(obj.name) === trimModifiers(modifierName)) { |
| 44 | return { ...obj, inactive: obj.element.classList.contains("modifier-toggle-inactive") } |
| 45 | } |
| 46 | |
| 47 | return obj |
| 48 | }) |
| 49 | document.dispatchEvent(new Event("refreshImageModifiers")) |
| 50 | } |
| 51 | }) |
| 52 | } |
| 53 | })() |
no test coverage detected