mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-03-22 15:17:23 +01:00
Fix highlightEditorLine to clear all .hovered elements, not just .states.hovered
Co-authored-by: Azgaar <26469650+Azgaar@users.noreply.github.com>
This commit is contained in:
parent
b63589914a
commit
1a032e1db5
2 changed files with 2 additions and 2 deletions
|
|
@ -1290,7 +1290,7 @@ function openStateMergeDialog() {
|
|||
const statesSelector = validStates
|
||||
.map(
|
||||
s => /* html */ `
|
||||
<div class="states" data-id="${s.i}" data-tip="${s.fullName}" style="cursor:default">
|
||||
<div data-id="${s.i}" data-tip="${s.fullName}" style="cursor:default">
|
||||
<input type="radio" name="rulingState" value="${s.i}" />
|
||||
<input id="selectState${s.i}" class="checkbox" type="checkbox" name="statesToMerge" value="${s.i}" />
|
||||
<label for="selectState${s.i}" class="checkbox-label"><fill-box fill="${s.color}" disabled></fill-box>${emblem(s.i)}${s.fullName}</label>
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ function showMapTooltip(point, e, i, g) {
|
|||
}
|
||||
|
||||
function highlightEditorLine(editor, id, timeout = 10000) {
|
||||
Array.from(editor.getElementsByClassName("states hovered")).forEach(el => el.classList.remove("hovered")); // clear all hovered
|
||||
Array.from(editor.getElementsByClassName("hovered")).forEach(el => el.classList.remove("hovered")); // clear all hovered
|
||||
const hovered = Array.from(editor.querySelectorAll("div")).find(el => el.dataset.id == id);
|
||||
if (hovered) hovered.classList.add("hovered"); // add hovered class
|
||||
if (timeout)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue