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
|
// Make chat stick to right hand side of screen
|
||||||
stickToScreen(fromInitialCall) {
|
stickToScreen(fromInitialCall) {
|
||||||
|
if ($('#options-stickychat').prop('checked')) {
|
||||||
|
$('#options-stickychat').prop('checked', false);
|
||||||
|
}
|
||||||
if (pad.settings.hideChat) {
|
if (pad.settings.hideChat) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -412,6 +412,7 @@ const pad = {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
padeditor.ace.focus();
|
padeditor.ace.focus();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
$('#options-stickychat').on('click', () => { chat.stickToScreen(); });
|
||||||
// if we have a cookie for always showing chat then show it
|
// if we have a cookie for always showing chat then show it
|
||||||
if (padcookie.getPref('chatAlwaysVisible')) {
|
if (padcookie.getPref('chatAlwaysVisible')) {
|
||||||
chat.stickToScreen(true); // stick it to the screen
|
chat.stickToScreen(true); // stick it to the screen
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<% e.begin_block("mySettings"); %>
|
<% e.begin_block("mySettings"); %>
|
||||||
<h2 data-l10n-id="pad.settings.myView"></h2>
|
<h2 data-l10n-id="pad.settings.myView"></h2>
|
||||||
<p class="hide-for-mobile">
|
<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>
|
<label for="options-stickychat" data-l10n-id="pad.settings.stickychat"></label>
|
||||||
</p>
|
</p>
|
||||||
<p class="hide-for-mobile">
|
<p class="hide-for-mobile">
|
||||||
|
|
Loading…
Reference in New Issue