From f632ad988083cdfbf23748f71e443dbce3e713be Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Mon, 27 Sep 2021 23:38:41 -0400 Subject: [PATCH] Use a more robust scheme for restorePrompt The original way didn't work properly in Firefox on Android when you select all text and replace it with something else. --- static/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 04a5a45b..b696e85c 100644 --- a/static/application.js +++ b/static/application.js @@ -881,8 +881,8 @@ function syncAllModifiedChunks(including_selected_chunks=false) { } function restorePrompt() { - if($("#gametext > chunk").length == 0 && game_text[0].innerText.trim().length) { - saved_prompt = game_text[0].innerText.replace(/\u00a0/g, " "); + if(game_text[0].firstChild.nodeType === 3) { + saved_prompt = game_text[0].firstChild.textContent.replace(/\u00a0/g, " "); unbindGametext(); game_text[0].innerText = ""; bindGametext();