diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-01-25 12:56:52 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-01-25 12:56:52 +0100 |
commit | 019dcefecad12fb99f5b5caddd6a73ed4a99addb (patch) | |
tree | 47f4bd5e86ba0defc28f56395b2c0e75696d6b29 /view | |
parent | f7309b926b861e1ce1717102f6ceb8408193352f (diff) | |
download | volse-hubzilla-019dcefecad12fb99f5b5caddd6a73ed4a99addb.tar.gz volse-hubzilla-019dcefecad12fb99f5b5caddd6a73ed4a99addb.tar.bz2 volse-hubzilla-019dcefecad12fb99f5b5caddd6a73ed4a99addb.zip |
reset timer on manual update trigger
Diffstat (limited to 'view')
-rw-r--r-- | view/js/main.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/view/js/main.js b/view/js/main.js index 89202c94f..41ca0bb3f 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -70,6 +70,8 @@ $(document).ready(function() { if(! $('#nav-' + notifyType + '-sub').hasClass('show')) { loadNotificationItems(notifyType); + if(timer) clearTimeout(timer); + timer = setTimeout(updateInit,updateInterval); } $(this).data('clicked', true); @@ -389,10 +391,9 @@ function notificationsUpdate(cached_data) { } var notifyType = null; - - if($('.notification-content.show').length) + if($('.notification-content.show').length) { notifyType = $('.notification-content.show').data('type'); - + } if(notifyType !== null) { loadNotificationItems(notifyType); } @@ -437,7 +438,6 @@ function handleNotifications(data) { } function handleNotificationsItems(notifyType, data) { - var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html()); var notify_menu = $("#nav-" + notifyType + "-menu"); @@ -931,11 +931,9 @@ function justifyPhotosAjax(id) { } function loadNotificationItems(notifyType) { - var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : ''); var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked'); - if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) { var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache')); handleNotificationsItems(notifyType, cached_data); |