From 81c83dfef757e723104152a311c78d670f7176a1 Mon Sep 17 00:00:00 2001 From: Gnome Ann <> Date: Mon, 23 Aug 2021 14:25:40 -0400 Subject: [PATCH] Fix bug where chunks still editable with Allow Editing off If, with Allow Editing on, you change a chunk and then click directly on the "Allow Editing" switch again to turn it off without defocusing the chunk in-between (by clicking outside the chunk, using enter/escape, etc), all story chunks would still be editable. That behaviour has now been fixed. --- static/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/application.js b/static/application.js index 8764bc60..0b89b4c4 100644 --- a/static/application.js +++ b/static/application.js @@ -774,8 +774,8 @@ $(document).ready(function(){ $('body').on('input', autofocus).on('keydown', 'chunk', chunkOnKeyDown).on('focusout', 'chunk', submitEditedChunk); $('#allowediting').prop('checked', allowedit).prop('disabled', false).change().on('change', function () { if(allowtoggle) { - checked = $(this).prop('checked') - $("chunk").attr('contenteditable', checked) + allowedit = $(this).prop('checked') + $("chunk").attr('contenteditable', allowedit) } }); } else if(msg.cmd == "updatescreen") {