diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 947323fca..79863a527 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1173,7 +1173,9 @@ define([ common.getAttribute(['hideHelp', type], function (err, val) { //if ($(window).height() < 800 || $(window).width() < 800) { return void toggleHelp(true); } if (val === true) { return void toggleHelp(true); } - if (!val && ($(window).height() < 800 || $(window).width() < 800)) { + // Note: Help is always hidden by default now, to avoid displaying to many things in the UI + // This is why we have (true || ...) + if (!val && (true || $(window).height() < 800 || $(window).width() < 800)) { return void showMore(); } }); diff --git a/www/common/common-util.js b/www/common/common-util.js index e9c4c1978..7afbf7c27 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -306,6 +306,10 @@ define([], function () { ]; }; + Util.isSmallScreen = function () { + return window.innerHeight < 800 || window.innerWidth < 800; + }; + return Util; }); }(self)); diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index 092a84036..feda0e47e 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -413,7 +413,7 @@ MessengerUI, Messages) { }); show(); Common.getAttribute(['toolbar', 'userlist-drawer'], function (err, val) { - if (val === false || ($(window).height() < 800 && $(window).width() < 800)) { + if (val === false || Util.isSmallScreen()) { return void hide(); } show(); @@ -457,7 +457,11 @@ MessengerUI, Messages) { config.$contentContainer.prepend($content); } - var hide = function () { + var hide = function (closed) { + if (!closed) { + // It means it's the initial state so we're going to make the icon blink + $button.addClass('cp-toolbar-notification'); + } $content.hide(); $button.removeClass('cp-toolbar-button-active'); config.$contentContainer.removeClass('cp-chat-visible'); @@ -482,8 +486,8 @@ MessengerUI, Messages) { }); show(); Common.getAttribute(['toolbar', 'chat-drawer'], function (err, val) { - if (val === false || ($(window).height() < 800 || $(window).width() < 800)) { - return void hide(); + if (!val || Util.isSmallScreen()) { + return void hide(val === false); } show(); });