diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-10-18 12:28:56 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-10-18 12:28:56 +0200 |
commit | ca4c725d57b0da9e6ea925023fb7487d4df48b2a (patch) | |
tree | cf0238b074e51c01f2ef2141c2c96c2e74551a05 /view/js | |
parent | fe1aa90304862983742a8d6f0f4cb59c971a7602 (diff) | |
download | volse-hubzilla-ca4c725d57b0da9e6ea925023fb7487d4df48b2a.tar.gz volse-hubzilla-ca4c725d57b0da9e6ea925023fb7487d4df48b2a.tar.bz2 volse-hubzilla-ca4c725d57b0da9e6ea925023fb7487d4df48b2a.zip |
remove redundant js
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/view/js/main.js b/view/js/main.js index 512b6e45b..b4c2bcf5d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -458,7 +458,9 @@ function NavUpdate() { } $.each(data, function(index, item) { - if(index == 'notice' || index == 'info') + //do not process those + var arr = ['notice', 'info', 'invalid']; + if(arr.indexOf(index) !== -1) return; if(item == 0) { @@ -942,26 +944,21 @@ function notify_popup_loader(notifyType) { window.location.href=window.location.href; } - if(data.notify.length == 0){ - $("#navbar-" + notifyType + "-menu").html(aStr[nothingnew]); - $("#nav-" + notifyType + "-menu").html(aStr[nothingnew]); - } else { - $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark); - $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); + $("#navbar-" + notifyType + "-menu").html(notifications_all + notifications_mark); + $("#nav-" + notifyType + "-menu").html(notifications_all + notifications_mark); - $(data.notify).each(function() { - html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); - $("#navbar-" + notifyType + "-menu").append(html); + $(data.notify).each(function() { + html = navbar_notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); + $("#navbar-" + notifyType + "-menu").append(html); + html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); + $("#nav-" + notifyType + "-menu").append(html); + }); - html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass); - $("#nav-" + notifyType + "-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"); - }); - } + $(".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"); + }); }); setTimeout(function() { |