Chat: avoid inline onclick handler to support jQuery 3.4+

jquery-update
webzwo0i 2021-07-07 02:30:12 +02:00 committed by Richard Hansen
parent 3459f36d23
commit cc677474b4
3 changed files with 5 additions and 1 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -122,7 +122,7 @@
<% e.begin_block("mySettings"); %>
<h2 data-l10n-id="pad.settings.myView"></h2>
<p class="hide-for-mobile">
<input type="checkbox" id="options-stickychat" onClick="chat.stickToScreen();">
<input type="checkbox" id="options-stickychat">
<label for="options-stickychat" data-l10n-id="pad.settings.stickychat"></label>
</p>
<p class="hide-for-mobile">