From d686f2d96df0f73602ab633a48b10cd35f44dd40 Mon Sep 17 00:00:00 2001 From: ebolam Date: Wed, 14 Sep 2022 20:11:26 -0400 Subject: [PATCH] Fix for pulsing on blank area in new game --- static/koboldai.js | 12 ++++++++++-- templates/index_new.html | 11 +++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/static/koboldai.js b/static/koboldai.js index 77fe20c9..f70b5d89 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -2108,16 +2108,24 @@ function select_game_text(event) { selected_game_chunk = new_selected_game_chunk } + //since we have that delete me span for initial spacing, we don't want that to be editable, so let's fix that here + if (selected_game_chunk == document.getElementById("Delete Me")) { + selected_game_chunk = null; + } + //set editting class for (item of document.getElementsByClassName("editing")) { item.classList.remove("editing"); } - selected_game_chunk.classList.add("editing"); + if (selected_game_chunk != null) { + selected_game_chunk.classList.add("editing"); + } } } function edit_game_text() { - if ((selected_game_chunk != null) && (selected_game_chunk.textContent != selected_game_chunk.original_text)) { + if ((selected_game_chunk != null) && (selected_game_chunk.textContent != selected_game_chunk.original_text) && (selected_game_chunk != document.getElementById("Delete Me"))) { + console.log(selected_game_chunk); if (selected_game_chunk.id == "story_prompt") { sync_to_server(selected_game_chunk); } else { diff --git a/templates/index_new.html b/templates/index_new.html index c4fbd8c4..9894433f 100644 --- a/templates/index_new.html +++ b/templates/index_new.html @@ -49,6 +49,17 @@

Disconnected

+ + +                          +                          +                          +                          +                          +                          +                          + +