]> git.mxchange.org Git - friendica.git/blobdiff - js/main.js
Merge pull request #2095 from rabuzarus/unread_forums
[friendica.git] / js / main.js
index d28133f03f7cda716c33aee27d9b042d8a430b25..f67d7183cedabb5e476e094459c386592a070ff9 100644 (file)
                var notifications_empty = unescape($("#nav-notifications-menu").html());
 
                /* nav update event  */
-               $('nav').bind('nav-update', function(e,data){;
+               $('nav').bind('nav-update', function(e,data){
                        var invalid = $(data).find('invalid').text();
                        if(invalid == 1) { window.location.href=window.location.href }
 
                        var birthdaystoday = $(data).find('birthdays-today').text();
                        if(birthdaystoday == 0) { $('#birthdays-update').removeClass('notif-birthdays-today') } else { $('#birthdays-update').addClass('notif-birthdays-today') }
 
+                       $(".sidebar-group-li .notify").removeClass("show");
+                       $(data).find("group").each(function() {
+                               var gid = this.id;
+                               var gcount = this.innerHTML;
+                               $(".group-"+gid+" .notify").addClass("show").text(gcount);
+                       });
+
+                       $(".forum-widget-entry .notify").removeClass("show");
+                       $(data).find("forum").each(function() {
+                               var fid = this.id;
+                               var fcount = this.innerHTML;
+                               $(".forum-"+fid+" .notify").addClass("show").text(fcount);
+                       });
+
 
                        var eNotif = $(data).find('notif')
 
@@ -872,7 +886,7 @@ var Dialog = {
         * to the event handler
         */
        doFileBrowser : function (name, id) {
-               var url = Dialog._get_url("image",name,id);
+               var url = Dialog._get_url("file",name,id);
                return Dialog.show(url);
        },