From 593d2f86db938bfed0d51ed67fa3e84eff16d15e Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 17 Nov 2009 19:04:59 +0100 Subject: [PATCH] Always keep the notification link if there is something in the log. Use background color of the highest level in the log. --- kronolith/js/kronolith.js | 17 ++++++++++++----- kronolith/templates/index/index.inc | 2 +- kronolith/themes/screen.css | 3 +++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index f8c601e46..0d36b8f45 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -121,17 +121,25 @@ KronolithCore = { return true; case 'horde.error': + case 'horde.warning': + //case 'horde.alarm': case 'horde.message': case 'horde.success': - case 'horde.warning': this.Growler.growl(m.message, { className: m.type.replace('.', '-'), life: 8, log: true, sticky: m.type == 'horde.error' }); - $('kronolithNotifications').update(Kronolith.text.alerts.interpolate({ 'count': ++this.growls })); - $('kronolithNotifications').up().show(); + var notify = $('kronolithNotifications'), + className = m.type.replace(/\./, '-'), + order = 'horde-error,horde-warning,horde-alarm,horde-message,horde-success'; + if (!notify.className || + order.indexOf(notify.className) > order.indexOf(className)) { + notify.className = className; + } + notify.update(Kronolith.text.alerts.interpolate({ 'count': ++this.growls })); + notify.up().show(); } }, this); }, @@ -2476,9 +2484,8 @@ KronolithCore = { case 'kronolithNotifications': if (this.Growler.toggleLog()) { elt.update(Kronolith.text.hidelog); - this.growls = 0; } else { - elt.up().hide(); + $('kronolithNotifications').update(Kronolith.text.alerts.interpolate({ 'count': this.growls })); } break; } diff --git a/kronolith/templates/index/index.inc b/kronolith/templates/index/index.inc index b0a141971..17fd40732 100644 --- a/kronolith/templates/index/index.inc +++ b/kronolith/templates/index/index.inc @@ -4,7 +4,7 @@
- ">2 notifications · + "> · · ' . $help_link; if ($logout_link) echo ' | ' . $logout_link ?>
diff --git a/kronolith/themes/screen.css b/kronolith/themes/screen.css index 9bc575f6d..98a37b3f5 100644 --- a/kronolith/themes/screen.css +++ b/kronolith/themes/screen.css @@ -389,6 +389,9 @@ body.kronolithAjax { margin-right: 10px; text-align: right; } +#kronolithNotifications { + padding: 3px 5px; +} /* Main area */ #kronolithMain { -- 2.11.0