Always keep the notification link if there is something in the log. Use background...
authorJan Schneider <jan@horde.org>
Tue, 17 Nov 2009 18:04:59 +0000 (19:04 +0100)
committerJan Schneider <jan@horde.org>
Tue, 17 Nov 2009 18:04:59 +0000 (19:04 +0100)
kronolith/js/kronolith.js
kronolith/templates/index/index.inc
kronolith/themes/screen.css

index f8c601e..0d36b8f 100644 (file)
@@ -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;
             }
index b0a1419..17fd407 100644 (file)
@@ -4,7 +4,7 @@
 
   <!-- begin services -->
   <div id="kronolithServices">
-   <span style="display:none"><a href="#" id="kronolithNotifications" title="<?php echo _("These items need your attention") ?>">2 notifications</a> <span class="kronolithSeparator">&middot;</span></span>
+   <span style="display:none"><a href="#" id="kronolithNotifications" title="<?php echo _("These items need your attention") ?>"></a> <span class="kronolithSeparator">&middot;</span></span>
    <a href="#" id="kronolithOptions"><?php echo _("Options") ?></a><?php if ($help_link) echo ' <span class="kronolithSeparator">&middot;</span> ' . $help_link; if ($logout_link) echo ' <span class="kronolithSeparator">|</span> ' . $logout_link ?>
   </div>
   <!-- end services -->
index 9bc575f..98a37b3 100644 (file)
@@ -389,6 +389,9 @@ body.kronolithAjax {
     margin-right: 10px;
     text-align: right;
 }
+#kronolithNotifications {
+    padding: 3px 5px;
+}
 
 /* Main area */
 #kronolithMain {