mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 23:46:14 -04:00
prevent sticky chat and chatAndUsers for mobile
This commit is contained in:
parent
c945c57a87
commit
5e6ceb071e
3 changed files with 17 additions and 2 deletions
|
@ -67,3 +67,7 @@ input {
|
||||||
.right {
|
.right {
|
||||||
float: right
|
float: right
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
.hide-for-mobile { display: none; }
|
||||||
|
}
|
|
@ -557,6 +557,17 @@ var pad = {
|
||||||
pad.changeViewOption('padFontFamily', padcookie.getPref("padFontFamily"));
|
pad.changeViewOption('padFontFamily', padcookie.getPref("padFontFamily"));
|
||||||
$('#viewfontmenu').val(padcookie.getPref("padFontFamily")).niceSelect('update');
|
$('#viewfontmenu').val(padcookie.getPref("padFontFamily")).niceSelect('update');
|
||||||
|
|
||||||
|
// Prevent sticky chat or chat and users to be checked for mobiles
|
||||||
|
function checkChatAndUsersVisibility(x) {
|
||||||
|
if (x.matches) { // If media query matches
|
||||||
|
$('#options-chatandusers:checked').click();
|
||||||
|
$('#options-stickychat:checked').click();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var mobileMatch = window.matchMedia("(max-width: 800px)");
|
||||||
|
mobileMatch.addListener(checkChatAndUsersVisibility); // check if window resized
|
||||||
|
setTimeout(function() { checkChatAndUsersVisibility(mobileMatch); }, 0); // check now after load
|
||||||
|
|
||||||
hooks.aCallAll("postAceInit", {ace: padeditor.ace, pad: pad});
|
hooks.aCallAll("postAceInit", {ace: padeditor.ace, pad: pad});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -121,11 +121,11 @@
|
||||||
<h1 data-l10n-id="pad.settings.padSettings"></h1>
|
<h1 data-l10n-id="pad.settings.padSettings"></h1>
|
||||||
<% 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>
|
<p class="hide-for-mobile">
|
||||||
<input type="checkbox" id="options-stickychat" onClick="chat.stickToScreen();">
|
<input type="checkbox" id="options-stickychat" onClick="chat.stickToScreen();">
|
||||||
<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>
|
<p class="hide-for-mobile">
|
||||||
<input type="checkbox" id="options-chatandusers" onClick="chat.chatAndUsers();">
|
<input type="checkbox" id="options-chatandusers" onClick="chat.chatAndUsers();">
|
||||||
<label for="options-chatandusers" data-l10n-id="pad.settings.chatandusers"></label>
|
<label for="options-chatandusers" data-l10n-id="pad.settings.chatandusers"></label>
|
||||||
</p>
|
</p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue