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.
This commit is contained in:
Gnome Ann 2021-09-27 23:38:41 -04:00
parent e8cefcc2c6
commit f632ad9880
1 changed files with 2 additions and 2 deletions

View File

@ -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();