Deselect on select state exit

This commit is contained in:
artisticMink 2023-11-05 16:57:14 +01:00
parent c584da2ea9
commit 2d42882a4b
1 changed files with 6 additions and 1 deletions

View File

@ -418,8 +418,13 @@ class BulkEditOverlay {
dismissCharacter = characterId => this.#selectedCharacters = this.selectedCharacters.filter(item => String(characterId) !== item);
/**
* Clears internal character storage and
* removes visual highlight.
*/
clearSelectedCharacters = () => {
this.selectedCharacters.forEach(characterId => document.querySelector('.character_select[chid="' + characterId + '"]')?.classList.remove(BulkEditOverlay.selectedClass))
document.querySelectorAll('#' + BulkEditOverlay.containerId + ' .' + BulkEditOverlay.selectedClass)
.forEach( element => element.classList.remove(BulkEditOverlay.selectedClass));
this.selectedCharacters.length = 0;
}
}