diff options
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/view/js/main.js b/view/js/main.js index dbaa9a360..041ecdd43 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1805,14 +1805,16 @@ function sse_bs_notifications(e, replace, followup) { var cn_val = (($('#cn-' + sse_type + '-input').length && sse_partial_result) ? $('#cn-' + sse_type + '-input').val().toString().toLowerCase() : ''); + $("#nav-" + sse_type + "-loading").show(); + $.get('/sse_bs/' + sse_type + '/' + sse_offset + '?nquery=' + encodeURIComponent(cn_val), function(obj) { console.log('sse: bootstraping ' + sse_type); console.log(obj); sse_bs_active = false; sse_offset = obj[sse_type].offset; - if(sse_offset < 0) - $("#nav-" + sse_type + "-loading").hide(); + + $("#nav-" + sse_type + "-loading").hide(); sse_handleNotifications(obj, replace, followup); @@ -1864,6 +1866,15 @@ function sse_handleNotifications(obj, replace, followup) { }); } + // load more notifications if visible notifications count becomes < 15 + if(sse_type) { + if($('#nav-' + sse_type + '-menu').children().length < 15) { + if(!sse_bs_active) { + sse_bs_notifications(sse_type, false, true); + } + } + } + } function sse_handleNotificationsItems(notifyType, data, replace, followup) { @@ -1978,4 +1989,5 @@ function sse_setNotificationsStatus() { $('#no_notifications').show(); $('#notifications').hide(); } + } |