aboutsummaryrefslogtreecommitdiffstats
path: root/view/js/main.js
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-01-28 21:43:50 -0800
committerzotlabs <mike@macgirvin.com>2018-01-28 21:43:50 -0800
commitc1e44c0f54e2dc9a340f0d619fa8082ec12947c1 (patch)
tree3bb0deca1c350445bcc8935afa2536bd842007e7 /view/js/main.js
parent5cf2bf6b29fde04ddc791af8ce21731818bedb7a (diff)
parentedf6ad9eda323f6e04823b8c110d21d82d519d32 (diff)
downloadvolse-hubzilla-c1e44c0f54e2dc9a340f0d619fa8082ec12947c1.tar.gz
volse-hubzilla-c1e44c0f54e2dc9a340f0d619fa8082ec12947c1.tar.bz2
volse-hubzilla-c1e44c0f54e2dc9a340f0d619fa8082ec12947c1.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'view/js/main.js')
-rw-r--r--view/js/main.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 13d002968..02b0f125c 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -75,8 +75,6 @@ $(document).ready(function() {
else {
sessionStorage.removeItem('notification_open');
}
-
- $(this).data('clicked', true);
});
if(sessionStorage.getItem('notification_open') !== null) {
@@ -456,11 +454,7 @@ function handleNotificationsItems(notifyType, data) {
notify_menu.append(html);
});
- $(".dropdown-menu img[data-src], .notification img[data-src]").each(function(i, el){
- // Replace data-src attribute with src attribute for every image
- $(el).attr('src', $(el).data("src"));
- $(el).removeAttr("data-src");
- });
+ datasrc2src('#notifications .notification img[data-src]');
if($('#tt-' + notifyType + '-only').hasClass('active'))
$('#nav-' + notifyType + '-menu [data-thread_top=false]').hide();
@@ -834,7 +828,7 @@ function liveUpdate(notify_id) {
// else data was valid - reset the recursion counter
liveRecurse = 0;
- if(typeof notify_id !== 'undefined') {
+ if(typeof notify_id !== 'undefined' && notify_id !== 'undefined') {
$.post(
"hq",
{
@@ -942,9 +936,11 @@ 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);
+ $('[data-type=\'' + notifyType + '\']').data('clicked',true);
console.log('updating ' + notifyType + ' notifications from cache...');
}
else {