refactor: fix race condition for chat/notif timeago. css tweaks

main
Barış Soner Uşaklı 3 years ago
parent 68aad8c10f
commit abe597b649

@ -245,6 +245,7 @@
.teaser-timestamp { .teaser-timestamp {
font-size: 10px; font-size: 10px;
margin-top: 10px; margin-top: 10px;
margin-right: 10px;
} }
a { a {

@ -31,6 +31,11 @@
display: block; display: block;
min-height: 32px; min-height: 32px;
} }
.relTime {
font-size: 10px;
margin-top: 10px;
margin-right: 10px;
}
} }
.mark-read { .mark-read {

@ -179,10 +179,16 @@
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.teaser-timestamp {
margin-right: 10px;
}
} }
} }
.menu-section { .menu-section {
.notification-list-mobile li .text {
display: block;
}
.chat-list, .notification-list-mobile { .chat-list, .notification-list-mobile {
.user-link { .user-link {
display: inline; display: inline;

@ -283,15 +283,6 @@ $(document).ready(function () {
}); });
if (chatMenuVisible) { 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 () { navSlideout.on('beforeopen', function () {
chatsSlideout.close(); chatsSlideout.close();
chatsSlideout.disable(); chatsSlideout.disable();
@ -314,11 +305,15 @@ $(document).ready(function () {
} }
}); });
// right slideout chats menu // right slideout notifications & chats menu
function loadChats() { function loadNotificationsAndChats() {
require(['chat'], function (chat) { require(['notifications', 'chat'], function (notifications, chat) {
chat.loadChatsDropdown($('#chats-menu .chat-list')); 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 chatsSlideout
.on('opened', loadChats) .on('opened', loadNotificationsAndChats)
.on('beforeopen', function () { .on('beforeopen', function () {
navSlideout.close().disable(); navSlideout.close().disable();
}) })

Loading…
Cancel
Save