Fix type errors in BulkEditOverlay
| @@ -101,7 +101,7 @@ class CharacterContextMenu { | ||
| 101 | 101 | * @param {number} characterId |
| 102 | 102 | * @returns {Promise<void>} |
| 103 | 103 | */ |
| 104 | 104 | static persona = async (characterId) => void(await convertCharacterToPersona(characterId)); |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * Delete one or more characters, |
| @@ -342,7 +342,7 @@ class BulkTagPopupHandler { | ||
| 342 | 342 | |
| 343 | 343 | for (const characterId of this.characterIds) { |
| 344 | 344 | for (const tag of mutualTags) { |
| 345 | 345 | removeTagFromMap(tag.id, characterId.toString()); |
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
| @@ -370,7 +370,7 @@ class BulkEditOverlayState { | ||
| 370 | 370 | * Implement a SingletonPattern, allowing access to the group overlay instance |
| 371 | 371 | * from everywhere via (new CharacterGroupOverlay()) |
| 372 | 372 | * |
| 373 | 373 | * @type {Readonly<BulkEditOverlay>} |
| 374 | 374 | */ |
| 375 | 375 | let bulkEditOverlayInstance = null; |
| 376 | 376 | |
| @@ -590,7 +590,8 @@ class BulkEditOverlay { | ||
| 590 | 590 | this.selectState(); |
| 591 | 591 | } else if (this.state === BulkEditOverlayState.select) { |
| 592 | 592 | this.#contextMenuOpen = true; |
| 593 | - CharacterContextMenu.show(...this.#getContextMenuPosition(event)); | |
| 593 | + const [x, y] = this.#getContextMenuPosition(event); | |
| 594 | + CharacterContextMenu.show(x, y); | |
| 594 | 595 | } |
| 595 | 596 | } |
| 596 | 597 | |
| @@ -694,7 +695,7 @@ class BulkEditOverlay { | ||
| 694 | 695 | const characterId = Number(character.getAttribute('data-chid')); |
| 695 | 696 | |
| 696 | 697 | const select = !this.selectedCharacters.includes(characterId); |
| 697 | 698 | const legacyBulkEditCheckbox = /** @type {HTMLInputElement} */ (character.querySelector('.' + BulkEditOverlay.legacySelectedClass)); |
| 698 | 699 | |
| 699 | 700 | if (select) { |
| 700 | 701 | character.classList.add(BulkEditOverlay.selectedClass); |
| @@ -753,7 +754,8 @@ class BulkEditOverlay { | ||
| 753 | 754 | |
| 754 | 755 | handleContextMenuShow = (event) => { |
| 755 | 756 | event.preventDefault(); |
| 756 | 757 | CharacterContextMenu.show(...const [x,y] = this.#getContextMenuPosition(event)); |
| 758 | + CharacterContextMenu.show(x, y); | |
| 757 | 759 | this.#contextMenuOpen = true; |
| 758 | 760 | }; |
| 759 | 761 | |
| @@ -761,6 +763,7 @@ class BulkEditOverlay { | ||
| 761 | 763 | let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId); |
| 762 | 764 | if (false === contextMenu.contains(event.target)) { |
| 763 | 765 | CharacterContextMenu.hide(); |
| 766 | + this.#contextMenuOpen = false; | |
| 764 | 767 | } |
| 765 | 768 | }; |
| 766 | 769 | |