Add logVisible() and logSize() functions to Growler.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 2 Feb 2010 07:47:09 +0000 (00:47 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 2 Feb 2010 08:07:34 +0000 (01:07 -0700)
horde/js/Growler.js

index b333443..eff6bc8 100644 (file)
                 return;
             }
 
-            var tmp = this.growlerlog.down('DIV'),
-                v = !tmp.visible();
-
-            Effect.toggle(tmp, 'blind', {
+            Effect.toggle(this.growlerlog.down('DIV'), 'blind', {
                 duration: 0.5,
                 queue: {
                     position: 'end',
                 }
             });
 
-            return v;
+            this.logvisible = !this.logvisible;
+        },
+
+        logVisible: function()
+        {
+            return this.growlerlog && this.logvisible;
+        },
+
+        logSize: function()
+        {
+            return (this.growlerlog && this.growlerlog.down('.NoAlerts'))
+                ? 0
+                : this.growlerlog.down('UL').childElements().size();
         }
 
     });