From ae41ad298cc54a1ef9972cef57dd25455b07f9fe Mon Sep 17 00:00:00 2001 From: vfbd Date: Sun, 26 Jun 2022 13:40:58 -0400 Subject: [PATCH] Make sure editor changes are applied before submitting --- static/application.js | 3 ++- templates/index.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 5b9820d2..a7a10016 100644 --- a/static/application.js +++ b/static/application.js @@ -891,6 +891,7 @@ function dosubmit(disallow_abort) { if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) { return; } + chunkOnFocusOut("override"); input_text.val(""); hideMessage(); hidegenseqs(); @@ -1969,7 +1970,7 @@ function chunkOnKeyDownSelectionChange(event) { // This gets run when you defocus the editor by clicking // outside of the editor or by pressing escape or tab function chunkOnFocusOut(event) { - if(!gametext_bound || !allowedit || event.target !== game_text[0]) { + if(event !== "override" && (!gametext_bound || !allowedit || event.target !== game_text[0])) { return; } setTimeout(function() { diff --git a/templates/index.html b/templates/index.html index 2603dec2..9cc53626 100644 --- a/templates/index.html +++ b/templates/index.html @@ -17,7 +17,7 @@ - + {% if flaskwebgui %}