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 {
font-size: 10px;
margin-top: 10px;
margin-right: 10px;
}
a {

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

@ -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;

@ -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();
})

Loading…
Cancel
Save