Fix sorting days in agenda view.
authorJan Schneider <jan@horde.org>
Sun, 21 Feb 2010 22:21:36 +0000 (23:21 +0100)
committerJan Schneider <jan@horde.org>
Mon, 22 Feb 2010 00:06:49 +0000 (01:06 +0100)
kronolith/js/kronolith.js

index 23873e1..b96ece9 100644 (file)
@@ -663,21 +663,21 @@ KronolithCore = {
         // Create a copy of the row template.
         var body = $('kronolithViewAgendaBody'),
             row = $('kronolithAgendaTemplate').cloneNode(true);
-        row.removeAttribute('id');
 
         // Fill week number and day cells.
-        row.down()
+        row.store('date', date)
+            .down()
             .setText(this.parseDate(date).toString('D'))
-            .store('date', date)
             .next()
             .writeAttribute('id', 'kronolithAgendaDay' + date);
+        row.removeAttribute('id');
 
         // Insert row.
         var nextRow;
         body.childElements().each(function(elm) {
-            if (elm.down().retrieve('date') > date) {
+            if (elm.retrieve('date') > date) {
                 nextRow = elm;
-                return;
+                throw $break;
             }
         });
         if (nextRow) {