From: Michael J. Rubinsky Date: Sat, 13 Nov 2010 18:51:08 +0000 (-0500) Subject: add links for next/prev day navigation (in addition to swipe). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=502a2a0666339afaa0c8ed59c3cf6f012294a50c;p=horde.git add links for next/prev day navigation (in addition to swipe). Really don't like the way the links look, but I've yet to find a way for jqm to render them better. --- diff --git a/kronolith/js/kronolithmobile.js b/kronolith/js/kronolithmobile.js index 9ee16fc0f..50d557be5 100644 --- a/kronolith/js/kronolithmobile.js +++ b/kronolith/js/kronolithmobile.js @@ -53,6 +53,24 @@ $("#eventcontent").text(data.response.event.t); }, 'json'); + }, + + showNextDay: function() + { + KronolithMobile.currentDate.addDays(1); + KronolithMobile.doAction('listEvents', + {'start': KronolithMobile.currentDate.toString("yyyyMMdd"), 'end': KronolithMobile.currentDate.toString("yyyyMMdd"), 'cal': Kronolith.conf.default_calendar}, + KronolithMobile.listEventsCallback + ); + }, + + showPrevDay: function() + { + KronolithMobile.currentDate.addDays(-1); + KronolithMobile.doAction('listEvents', + {'start': KronolithMobile.currentDate.toString("yyyyMMdd"), 'end': KronolithMobile.currentDate.toString("yyyyMMdd"), 'cal': Kronolith.conf.default_calendar}, + KronolithMobile.listEventsCallback + ); } }; @@ -71,21 +89,10 @@ $(function() { // For now, start at today's day view KronolithMobile.currentDate = new Date(); - $('body').bind('swipeleft', function(e) { - KronolithMobile.currentDate.addDays(1); - KronolithMobile.doAction('listEvents', - {'start': KronolithMobile.currentDate.toString("yyyyMMdd"), 'end': KronolithMobile.currentDate.toString("yyyyMMdd"), 'cal': Kronolith.conf.default_calendar}, - KronolithMobile.listEventsCallback - ); - }); - - $('body').bind('swiperight', function(e) { - KronolithMobile.currentDate.addDays(-1); - KronolithMobile.doAction('listEvents', - {'start': KronolithMobile.currentDate.toString("yyyyMMdd"), 'end': KronolithMobile.currentDate.toString("yyyyMMdd"), 'cal': Kronolith.conf.default_calendar}, - KronolithMobile.listEventsCallback - ); - }); + $('body').bind('swipeleft', KronolithMobile.showNextDay); + $('body').bind('swiperight', KronolithMobile.showPrevDay); + $('#prevDay').bind('click', KronolithMobile.showPrevDay); + $('#nextDay').bind('click', KronolithMobile.showNextDay); // Load today KronolithMobile.doAction('listEvents', diff --git a/kronolith/mobile.php b/kronolith/mobile.php index e7985514c..5dcfb6df6 100644 --- a/kronolith/mobile.php +++ b/kronolith/mobile.php @@ -38,7 +38,8 @@ require $registry->get('templates', 'horde') . '/common-header-mobile.inc';

My Calendar:Day

-

+
+