diff --git a/src/static/css/pad.css b/src/static/css/pad.css index bbec1b016..2e073dfdb 100644 --- a/src/static/css/pad.css +++ b/src/static/css/pad.css @@ -66,4 +66,8 @@ input { } .right { float: right +} + +@media (max-width: 800px) { + .hide-for-mobile { display: none; } } \ No newline at end of file diff --git a/src/static/js/pad.js b/src/static/js/pad.js index 673a6aa1d..1ba6f52ad 100644 --- a/src/static/js/pad.js +++ b/src/static/js/pad.js @@ -557,6 +557,17 @@ var pad = { pad.changeViewOption('padFontFamily', padcookie.getPref("padFontFamily")); $('#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}); } }, diff --git a/src/templates/pad.html b/src/templates/pad.html index d84a69aab..809635796 100644 --- a/src/templates/pad.html +++ b/src/templates/pad.html @@ -121,11 +121,11 @@

<% e.begin_block("mySettings"); %>

-

+

-

+