reset timer on manual update trigger
This commit is contained in:
parent
f7309b926b
commit
019dcefeca
@ -70,6 +70,8 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
if(! $('#nav-' + notifyType + '-sub').hasClass('show')) {
|
if(! $('#nav-' + notifyType + '-sub').hasClass('show')) {
|
||||||
loadNotificationItems(notifyType);
|
loadNotificationItems(notifyType);
|
||||||
|
if(timer) clearTimeout(timer);
|
||||||
|
timer = setTimeout(updateInit,updateInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
$(this).data('clicked', true);
|
$(this).data('clicked', true);
|
||||||
@ -389,10 +391,9 @@ function notificationsUpdate(cached_data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var notifyType = null;
|
var notifyType = null;
|
||||||
|
if($('.notification-content.show').length) {
|
||||||
if($('.notification-content.show').length)
|
|
||||||
notifyType = $('.notification-content.show').data('type');
|
notifyType = $('.notification-content.show').data('type');
|
||||||
|
}
|
||||||
if(notifyType !== null) {
|
if(notifyType !== null) {
|
||||||
loadNotificationItems(notifyType);
|
loadNotificationItems(notifyType);
|
||||||
}
|
}
|
||||||
@ -437,7 +438,6 @@ function handleNotifications(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleNotificationsItems(notifyType, data) {
|
function handleNotificationsItems(notifyType, data) {
|
||||||
|
|
||||||
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
|
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
|
||||||
var notify_menu = $("#nav-" + notifyType + "-menu");
|
var notify_menu = $("#nav-" + notifyType + "-menu");
|
||||||
|
|
||||||
@ -931,11 +931,9 @@ function justifyPhotosAjax(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadNotificationItems(notifyType) {
|
function loadNotificationItems(notifyType) {
|
||||||
|
|
||||||
var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
|
var pingExCmd = 'ping/' + notifyType + ((localUser != 0) ? '?f=&uid=' + localUser : '');
|
||||||
|
|
||||||
var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked');
|
var clicked = $('[data-type=\'' + notifyType + '\']').data('clicked');
|
||||||
|
|
||||||
if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) {
|
if((clicked === undefined) && (sessionStorage.getItem(notifyType + '_notifications_cache') !== null)) {
|
||||||
var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache'));
|
var cached_data = JSON.parse(sessionStorage.getItem(notifyType + '_notifications_cache'));
|
||||||
handleNotificationsItems(notifyType, cached_data);
|
handleNotificationsItems(notifyType, cached_data);
|
||||||
|
Reference in New Issue
Block a user