Make sure editor changes are applied before submitting

This commit is contained in:
vfbd
2022-06-26 13:40:58 -04:00
parent b99d1449c9
commit ae41ad298c
2 changed files with 3 additions and 2 deletions

View File

@ -891,6 +891,7 @@ function dosubmit(disallow_abort) {
if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) { if((disallow_abort || gamestate !== "wait") && !memorymode && !gamestarted && ((!adventure || !action_mode) && txt.trim().length == 0)) {
return; return;
} }
chunkOnFocusOut("override");
input_text.val(""); input_text.val("");
hideMessage(); hideMessage();
hidegenseqs(); hidegenseqs();
@ -1969,7 +1970,7 @@ function chunkOnKeyDownSelectionChange(event) {
// This gets run when you defocus the editor by clicking // This gets run when you defocus the editor by clicking
// outside of the editor or by pressing escape or tab // outside of the editor or by pressing escape or tab
function chunkOnFocusOut(event) { function chunkOnFocusOut(event) {
if(!gametext_bound || !allowedit || event.target !== game_text[0]) { if(event !== "override" && (!gametext_bound || !allowedit || event.target !== game_text[0])) {
return; return;
} }
setTimeout(function() { setTimeout(function() {

View File

@ -17,7 +17,7 @@
<script src="static/bootstrap.min.js"></script> <script src="static/bootstrap.min.js"></script>
<script src="static/bootstrap-toggle.min.js"></script> <script src="static/bootstrap-toggle.min.js"></script>
<script src="static/rangy-core.min.js"></script> <script src="static/rangy-core.min.js"></script>
<script src="static/application.js?ver=1.18.1d"></script> <script src="static/application.js?ver=1.18.1e"></script>
<script src="static/favicon.js"></script> <script src="static/favicon.js"></script>
{% if flaskwebgui %} {% if flaskwebgui %}
<script src="static/flask_web_gui.js"></script> <script src="static/flask_web_gui.js"></script>