From cc677474b45227b8f5b3689b8535506aeffab971 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Wed, 7 Jul 2021 02:30:12 +0200 Subject: [PATCH] Chat: avoid inline onclick handler to support jQuery 3.4+ --- src/static/js/chat.js | 3 +++ src/static/js/pad.js | 1 + src/templates/pad.html | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/static/js/chat.js b/src/static/js/chat.js index e84a8ca6b..9dee3be4f 100755 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -47,6 +47,9 @@ exports.chat = (() => { }, // Make chat stick to right hand side of screen stickToScreen(fromInitialCall) { + if ($('#options-stickychat').prop('checked')) { + $('#options-stickychat').prop('checked', false); + } if (pad.settings.hideChat) { return; } diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 3871cde96..88de4d435 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -412,6 +412,7 @@ const pad = { setTimeout(() => { padeditor.ace.focus(); }, 0); + $('#options-stickychat').on('click', () => { chat.stickToScreen(); }); // if we have a cookie for always showing chat then show it if (padcookie.getPref('chatAlwaysVisible')) { chat.stickToScreen(true); // stick it to the screen diff --git a/src/templates/pad.html b/src/templates/pad.html index bc3cec88e..54e1897d9 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -122,7 +122,7 @@ <% e.begin_block("mySettings"); %>

- +