"Fix" for issue 318. We simply remove the selection as the selection event is giving us the parent of the action so we don't know which action is selected

This commit is contained in:
ebolam
2022-11-27 11:56:47 -05:00
parent 0371fa1782
commit 074ec612eb

View File

@@ -2905,8 +2905,13 @@ function select_game_text(event) {
}
//Check to see if new selection is a game chunk or something else
if ((new_selected_game_chunk == null) || (((new_selected_game_chunk.id == "story_prompt") || (new_selected_game_chunk.id.slice(0,20) == "Selected Text Chunk ")) && (document.activeElement.isContentEditable))) {
if (new_selected_game_chunk == null) {
selected_game_chunk = null;
for (item of document.getElementsByClassName("editing")) {
item.classList.remove("editing");
}
window.getSelection().removeAllRanges()
} else if (((new_selected_game_chunk.id == "story_prompt") || (new_selected_game_chunk.id.slice(0,20) == "Selected Text Chunk ")) && (document.activeElement.isContentEditable)) {
if (new_selected_game_chunk != selected_game_chunk) {
for (item of document.getElementsByClassName("editing")) {
item.classList.remove("editing");