Only remove the correct alarm from the alarms cache.
authorJan Schneider <jan@horde.org>
Tue, 2 Mar 2010 22:44:55 +0000 (23:44 +0100)
committerJan Schneider <jan@horde.org>
Tue, 2 Mar 2010 23:02:34 +0000 (00:02 +0100)
kronolith/js/kronolith.js

index 97d196e..8da2208 100644 (file)
@@ -161,10 +161,14 @@ KronolithCore = {
                     log: false,
                     sticky: true
                 });
+                growl.store('alarm', alarm.id);
 
-                document.observe('Growler:destroyed', function() {
-                    this.alarms = this.alarms.without(alarm.id);
-                }.bind(this));
+                document.observe('Growler:destroyed', function(e) {
+                    var id = e.element().retrieve('alarm');
+                    if (id) {
+                        this.alarms = this.alarms.without(id);
+                    }
+                }.bindAsEventListener(this));
 
                 if (alarm.user) {
                     select.observe('change', function() {