aboutsummaryrefslogtreecommitdiffstats
path: root/include/main.js
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-07-25 17:12:42 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-07-25 17:12:42 +0200
commit23d6339a4152759d8dcf68afc6e7dea652336d8c (patch)
tree6c67c9aa83b6f12759479d226fcf957befd10814 /include/main.js
parentba4ea589d00d8d79291191156a64e903b36509aa (diff)
downloadvolse-hubzilla-23d6339a4152759d8dcf68afc6e7dea652336d8c.tar.gz
volse-hubzilla-23d6339a4152759d8dcf68afc6e7dea652336d8c.tar.bz2
volse-hubzilla-23d6339a4152759d8dcf68afc6e7dea652336d8c.zip
change to some nav ids, notice in empty notifications popup
Diffstat (limited to 'include/main.js')
-rw-r--r--include/main.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/main.js b/include/main.js
index dc39a7281..3574e6eb8 100644
--- a/include/main.js
+++ b/include/main.js
@@ -61,8 +61,9 @@
/* popup menus */
$('a[rel^=#]').click(function(e){
- e.stopPropagation();
menu = $( $(this).attr('rel') );
+ e.stopPropagation();
+ if (menu.attr('popup')=="false") return false;
$(this).parent().toggleClass("selected");
menu.toggle();
return false;
@@ -72,6 +73,7 @@
/* notifications template */
var notifications_tpl= unescape($("#nav-notifications-template[rel=template]").html());
+ var notifications_empty = unescape($("#nav-notifications-menu").html());
/* nav update event */
$('nav').bind('nav-update', function(e,data){;
@@ -88,12 +90,15 @@
if (notif>0){
nnm = $("#nav-notifications-menu");
nnm.html("");
+ nnm.attr('popup','true');
eNotif.children("note").each(function(){
e = $(this);
text = e.text().format("<span class='contactname'>"+e.attr('name')+"</span>");
html = notifications_tpl.format(e.attr('href'),e.attr('photo'), text, e.attr('date'));
nnm.append(html);
});
+ } else {
+ $("#nav-notifications-menu").html(notifications_empty);
}
if(notif == 0) { notif = ''; $('#notify-update').removeClass('show') } else { $('#notify-update').addClass('show') }
$('#notify-update').html(notif);