From abe597b649acf5b96905cad2e6fbdd05df4e8deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sat, 5 Feb 2022 15:57:31 -0500 Subject: [PATCH] refactor: fix race condition for chat/notif timeago. css tweaks --- less/chats.less | 1 + less/header.less | 5 +++++ less/mobile.less | 6 ++++++ public/persona.js | 23 +++++++++-------------- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/less/chats.less b/less/chats.less index 062dad0..6f1ee01 100644 --- a/less/chats.less +++ b/less/chats.less @@ -245,6 +245,7 @@ .teaser-timestamp { font-size: 10px; margin-top: 10px; + margin-right: 10px; } a { diff --git a/less/header.less b/less/header.less index e637fab..7349998 100644 --- a/less/header.less +++ b/less/header.less @@ -31,6 +31,11 @@ display: block; min-height: 32px; } + .relTime { + font-size: 10px; + margin-top: 10px; + margin-right: 10px; + } } .mark-read { diff --git a/less/mobile.less b/less/mobile.less index 2750292..c917dfc 100644 --- a/less/mobile.less +++ b/less/mobile.less @@ -179,10 +179,16 @@ white-space: nowrap; text-overflow: ellipsis; } + .teaser-timestamp { + margin-right: 10px; + } } } .menu-section { + .notification-list-mobile li .text { + display: block; + } .chat-list, .notification-list-mobile { .user-link { display: inline; diff --git a/public/persona.js b/public/persona.js index 9a66b4e..4c2e4aa 100644 --- a/public/persona.js +++ b/public/persona.js @@ -283,15 +283,6 @@ $(document).ready(function () { }); if (chatMenuVisible) { - chatsSlideout.on('opened', function loadNotifications() { - require(['notifications'], function (notifications) { - const notifList = $('#chats-menu [data-section="notifications"] ul'); - notifications.loadNotifications(notifList, function () { - notifList.find('.deco-none').removeClass('deco-none'); - }); - }); - }); - navSlideout.on('beforeopen', function () { chatsSlideout.close(); chatsSlideout.disable(); @@ -314,11 +305,15 @@ $(document).ready(function () { } }); - // right slideout chats menu + // right slideout notifications & chats menu - function loadChats() { - require(['chat'], function (chat) { - chat.loadChatsDropdown($('#chats-menu .chat-list')); + function loadNotificationsAndChats() { + require(['notifications', 'chat'], function (notifications, chat) { + const notifList = $('#chats-menu [data-section="notifications"] ul'); + notifications.loadNotifications(notifList, function () { + notifList.find('.deco-none').removeClass('deco-none'); + chat.loadChatsDropdown($('#chats-menu .chat-list')); + }); }); } @@ -332,7 +327,7 @@ $(document).ready(function () { }); chatsSlideout - .on('opened', loadChats) + .on('opened', loadNotificationsAndChats) .on('beforeopen', function () { navSlideout.close().disable(); })