]> git.mxchange.org Git - friendica.git/commitdiff
main.js: set notifications icon "on" with new unread notifcations. Show "Nothing...
authorFabio Comuni <fabrix.xm@gmail.com>
Thu, 12 Apr 2012 07:15:08 +0000 (09:15 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Thu, 12 Apr 2012 07:15:08 +0000 (09:15 +0200)
js/main.js

index 7f0428b5b5c2e92afe21394fa836638f2693fd6e..7a90fa91063581a40057c3562837ec18fc6d154a 100755 (executable)
                        $('#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);
                                        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
+}