diff --git a/lib/persona.js b/lib/persona.js index aa4a5bb..1f3ff90 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -117,7 +117,7 @@ $(document).ready(function() { require(['pulling', 'storage'], function (Pulling, Storage) { // initialization - var guest = !app.user || !parseInt(app.user.uid, 10); + var chatMenuVisible = !config.disableChat && app.user && parseInt(app.user.uid, 10); var swapped = !!Storage.getItem('persona:menus:legacy-layout'); var margin = window.innerWidth; @@ -140,7 +140,7 @@ $(document).ready(function() { $('#menu').removeClass('hidden'); var chatsSlideout; - if (!guest) { + if (chatMenuVisible) { chatsSlideout = Pulling.create({ panel: document.getElementById('panel'), menu: document.getElementById('chats-menu'), @@ -181,7 +181,7 @@ $(document).ready(function() { $('#panel').one('click', closeOnClick); }); - if (!guest) { + if (chatMenuVisible) { chatsSlideout .ignore('code, code *, .preventSlideout, .preventSlideout *') .on('closed', onClose) @@ -205,7 +205,7 @@ $(document).ready(function() { navSlideout.on('opened', loadNotifications); - if (!guest) { + if (chatMenuVisible) { navSlideout.on('beforeopen', function () { chatsSlideout.close(); chatsSlideout.disable(); @@ -234,7 +234,7 @@ $(document).ready(function() { }); } - if (!guest) { + if (chatMenuVisible) { $('#mobile-chats').removeClass('hidden').on('click', function() { navSlideout.close(); chatsSlideout.enable().toggle();