sill me, use jquery's $.each() method here
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 14 Nov 2010 23:46:38 +0000 (18:46 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sun, 14 Nov 2010 23:46:38 +0000 (18:46 -0500)
kronolith/js/kronolithmobile.js

index f6de9c5..d54b436 100644 (file)
 
     onDocumentReady: function()
     {
+        // Build list of calendars we want.
         KronolithMobile.calendars = [];
-        for (var key in Kronolith.conf.calendars) {
-           for (var cal in Kronolith.conf.calendars[key]) {
-               if (Kronolith.conf.calendars[key][cal].show) {
-                  KronolithMobile.calendars.push([key, cal]);
-               }
-           }
-        }
+        $.each(Kronolith.conf.calendars, function(key, value) {
+            $.each(value, function(cal, info) {
+                if (info.show) {
+                    KronolithMobile.calendars.push([key, cal]);
+                }
+            });
+        });
+
         // Global ajax options.
         $.ajaxSetup({
             dataFilter: function(data, type)