aboutsummaryrefslogtreecommitdiffstats
path: root/js/main.js
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-04-12 09:15:08 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2012-04-12 09:15:08 +0200
commita23d46c49b59f05d89a7c5a949ae9b9af107e7c9 (patch)
treeee95186b1c32609f19a2ecf732a872b7a05d6786 /js/main.js
parent18ecac4e933e96f4ddc8b53ee1291b70c2a99540 (diff)
downloadvolse-hubzilla-a23d46c49b59f05d89a7c5a949ae9b9af107e7c9.tar.gz
volse-hubzilla-a23d46c49b59f05d89a7c5a949ae9b9af107e7c9.tar.bz2
volse-hubzilla-a23d46c49b59f05d89a7c5a949ae9b9af107e7c9.zip
main.js: set notifications icon "on" with new unread notifcations. Show "Nothing new here" with no notifications at all
Diffstat (limited to 'js/main.js')
-rwxr-xr-xjs/main.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/main.js b/js/main.js
index 7f0428b5b..7a90fa910 100755
--- a/js/main.js
+++ b/js/main.js
@@ -137,13 +137,12 @@
$('#mail-update-li').html(mail);
var eNotif = $(data).find('notif')
- notif = eNotif.attr('count');
- if (notif>=0){
- $("#nav-notifications-linkmenu").addClass("on");
+
+ if (eNotif.children("note").length==0){
+ $("#nav-notifications-menu").html(notifications_empty);
+ } else {
nnm = $("#nav-notifications-menu");
-
nnm.html(notifications_all + notifications_mark);
-
//nnm.attr('popup','true');
eNotif.children("note").each(function(){
e = $(this);
@@ -151,10 +150,12 @@
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'), e.attr('seen'));
nnm.append(html);
});
-
+ }
+ notif = eNotif.attr('count');
+ if (notif>0){
+ $("#nav-notifications-linkmenu").addClass("on");
} else {
- // $("#nav-notifications-linkmenu").removeClass("on");
- // $("#nav-notifications-menu").html(notifications_empty);
+ $("#nav-notifications-linkmenu").removeClass("on");
}
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(notif);
@@ -609,4 +610,4 @@ function previewTheme(elm) {
$('#theme-preview').html('<div id="theme-desc">' + data.desc + '</div><a href="' + data.img + '"><img src="' + data.img + '" width="320" height="240" alt="' + theme + '" /></a>');
});
-} \ No newline at end of file
+}