diff options
author | Mario <mario@mariovavti.com> | 2021-07-27 07:07:53 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-07-27 07:07:53 +0000 |
commit | b19213b60be709c8e4b72f5e4b840f00c6c32a05 (patch) | |
tree | 4f700101a9b7e9dafc1bbd30ea7bd3f5bc5e8389 /view/js/main.js | |
parent | d8ac25c35a3183b173f5dc29c25b08ed7b51a875 (diff) | |
parent | 3c5b18913fcaa19373e122eb9b70fd9f2c4881b4 (diff) | |
download | volse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.tar.gz volse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.tar.bz2 volse-hubzilla-b19213b60be709c8e4b72f5e4b840f00c6c32a05.zip |
Merge branch 'dev'
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 54 |
1 files changed, 11 insertions, 43 deletions
diff --git a/view/js/main.js b/view/js/main.js index f427df8ad..9f794c2ea 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -548,8 +548,10 @@ function markRead(notifType) { $('#nav-' + notifType + '-menu').html(''); $('#nav-' + notifType + '-sub').removeClass('show'); sessionStorage.removeItem('notification_open'); - sse_setNotificationsStatus(); + $(document).trigger('hz:sse_setNotificationsStatus'); }); + + } function markItemRead(itemId) { @@ -717,52 +719,18 @@ function updateConvItems(mode,data) { } } - // take care of the notifications count updates - var nmids = $(this).data('b64mids'); - - nmids.forEach(function(nmid, index) { - - sse_rmids.push(nmid); - - if($('.notification[data-b64mid=\'' + nmid + '\']').length) { - $('.notification[data-b64mid=\'' + nmid + '\']').each(function() { - var n = this.parentElement.id.split('-'); - return sse_updateNotifications(n[1], nmid); - }); - } - - // special handling for forum notifications - $('.notification-forum').filter(function() { - var fmids = decodeURIComponent($(this).data('b64mids')); - var n = this.parentElement.id.split('-'); - if(fmids.indexOf(nmid) > -1) { - var fcount = Number($('.' + n[1] + '-update').html()); - fcount--; - $('.' + n[1] + '-update').html(fcount); - if(fcount < 1) - $('.' + n[1] + '-button').fadeOut(); - - var count = Number($(this).find('.badge-secondary').html()); - count--; - $(this).find('.badge-secondary').html(count); - if(count < 1) - $(this).remove(); - } - }); - - - }); - - sse_setNotificationsStatus(); + $(document).trigger('hz:sse_setNotificationsStatus', [$(this).data('b64mids')]); }); $(window).scrollTop(scroll_position); - if(followUpPageLoad) - sse_bs_counts(); - else - sse_bs_init(); + if(followUpPageLoad) { + $(document).trigger('hz:sse_bs_counts'); + } + else { + $(document).trigger('hz:sse_bs_init'); + } if(commentBusy) { commentBusy = false; @@ -902,7 +870,7 @@ function updateInit() { liveUpdate(); } else { - sse_bs_init(); + $(document).trigger('hz:sse_bs_init'); } if($('#live-photos').length || $('#live-cards').length || $('#live-articles').length ) { |