From 23d6339a4152759d8dcf68afc6e7dea652336d8c Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 25 Jul 2011 17:12:42 +0200 Subject: [PATCH] change to some nav ids, notice in empty notifications popup --- include/main.js | 7 ++++++- view/nav.tpl | 7 ++++--- view/theme/quattro/style.css | 11 ++++++++--- view/theme/quattro/style.less | 10 ++++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/include/main.js b/include/main.js index dc39a72816..3574e6eb8d 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(""+e.attr('name')+""); 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); diff --git a/view/nav.tpl b/view/nav.tpl index 454d7ebd0d..5a8a904a61 100644 --- a/view/nav.tpl +++ b/view/nav.tpl @@ -5,7 +5,7 @@