simplify, always call clearView() from loadEvents(), fix scope
authorMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 3 Dec 2010 05:47:10 +0000 (00:47 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Fri, 3 Dec 2010 05:48:52 +0000 (00:48 -0500)
kronolith/js/mobile.js

index 13dc9da..42a5658 100644 (file)
@@ -59,7 +59,7 @@
 
         // Clear out the loaded cal cache
         KronolithMobile.loadedCalendars = [];
-
+        KronolithMobile.clearView(view);
         $.each(KronolithMobile.calendars, function(key, cal) {
             var startDay = firstDay.clone() , endDay = lastDay.clone(),
             cals = KronolithMobile.ecache[cal[0]];
      */
     moveToDay: function(date)
     {
-        KronolithMobile.clearView('day');
         $('.kronolithDayDate').text(date.toString('ddd') + ' ' + date.toString('d'));
         KronolithMobile.date = date;
         KronolithMobile.loadEvents(date, date, 'day');
      */
     moveToMonth: function(date)
     {
-        KronolithMobile.clearView('month');
         var dates = KronolithMobile.viewDates(date, 'month');
         KronolithMobile.date = date;
         KronolithMobile.loadEvents(dates[0], dates[1], 'month');
         // Set up overview
         $('#overview').bind('pageshow', function(event, ui) {
             KronolithMobile.view = 'overview';
-            if (!haveOverView) {
-                KronolithMobile.clearView('overview');
+            if (!KronolithMobile.haveOverview) {
                 KronolithMobile.loadEvents(KronolithMobile.date, KronolithMobile.date.clone().addDays(7), 'overview');
+                KronolithMobile.haveOverview = true;
             }
         });