Chat: avoid inline onclick handler to support jQuery 3.4+
parent
3459f36d23
commit
cc677474b4
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue