Fix type errors in BulkEditOverlay
This commit is contained in:
@@ -101,7 +101,7 @@ class CharacterContextMenu {
|
||||
* @param {number} characterId
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
static persona = async (characterId) => await convertCharacterToPersona(characterId);
|
||||
static persona = async (characterId) => void(await convertCharacterToPersona(characterId));
|
||||
|
||||
/**
|
||||
* Delete one or more characters,
|
||||
@@ -342,7 +342,7 @@ class BulkTagPopupHandler {
|
||||
|
||||
for (const characterId of this.characterIds) {
|
||||
for (const tag of mutualTags) {
|
||||
removeTagFromMap(tag.id, characterId);
|
||||
removeTagFromMap(tag.id, characterId.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ class BulkEditOverlayState {
|
||||
* Implement a SingletonPattern, allowing access to the group overlay instance
|
||||
* from everywhere via (new CharacterGroupOverlay())
|
||||
*
|
||||
* @type BulkEditOverlay
|
||||
* @type {Readonly<BulkEditOverlay>}
|
||||
*/
|
||||
let bulkEditOverlayInstance = null;
|
||||
|
||||
@@ -590,7 +590,8 @@ class BulkEditOverlay {
|
||||
this.selectState();
|
||||
} else if (this.state === BulkEditOverlayState.select) {
|
||||
this.#contextMenuOpen = true;
|
||||
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
|
||||
const [x, y] = this.#getContextMenuPosition(event);
|
||||
CharacterContextMenu.show(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,7 +695,7 @@ class BulkEditOverlay {
|
||||
const characterId = Number(character.getAttribute('data-chid'));
|
||||
|
||||
const select = !this.selectedCharacters.includes(characterId);
|
||||
const legacyBulkEditCheckbox = character.querySelector('.' + BulkEditOverlay.legacySelectedClass);
|
||||
const legacyBulkEditCheckbox = /** @type {HTMLInputElement} */ (character.querySelector('.' + BulkEditOverlay.legacySelectedClass));
|
||||
|
||||
if (select) {
|
||||
character.classList.add(BulkEditOverlay.selectedClass);
|
||||
@@ -753,7 +754,8 @@ class BulkEditOverlay {
|
||||
|
||||
handleContextMenuShow = (event) => {
|
||||
event.preventDefault();
|
||||
CharacterContextMenu.show(...this.#getContextMenuPosition(event));
|
||||
const [x,y] = this.#getContextMenuPosition(event);
|
||||
CharacterContextMenu.show(x, y);
|
||||
this.#contextMenuOpen = true;
|
||||
};
|
||||
|
||||
@@ -761,6 +763,7 @@ class BulkEditOverlay {
|
||||
let contextMenu = document.getElementById(BulkEditOverlay.contextMenuId);
|
||||
if (false === contextMenu.contains(event.target)) {
|
||||
CharacterContextMenu.hide();
|
||||
this.#contextMenuOpen = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user