From 8506fddee0268c4aee353fc50f338cfa7ce70273 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 18 Nov 2010 01:26:44 -0500 Subject: [PATCH] Initial go at showing a clicked day's events on the monthview. --- kronolith/js/mobile.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/kronolith/js/mobile.js b/kronolith/js/mobile.js index 952a6c3ef..a24874f3e 100644 --- a/kronolith/js/mobile.js +++ b/kronolith/js/mobile.js @@ -210,6 +210,7 @@ if ($.isEmptyObject(event)) { return; } + var cal = event.calendar, type = cal.split('|')[0], c = cal.split('|')[1], d = $('
').attr({'style': 'color:' + Kronolith.conf.calendars[type][c].bg}), item = $('
  • '), a; @@ -677,6 +678,24 @@ $('body').unbind('swipeleft', KronolithMobile.showNextMonth); $('body').unbind('swiperight', KronolithMobile.showPrevMonth); }); + + // Click handler for selected month-days + // Attaching a live handler when matching a class that is added at + // runtime seems to fail + $('td').live('click', function(e) { + var ul = $('
      ').attr({ 'data-role': 'listview '}); + $('.kronolithDayDetail ul').detach(); + if ($(this).hasClass('kronolithSelected')) { + var li, events = KronolithMobile.getCacheForDate($(this).data('date')); + events = KronolithMobile.sortEvents(events); + $.each(events, function(k, e) { + ul.append(KronolithMobile.buildDayEvent(e)); + }); + } + ul.listview(); + $('.kronolithDayDetail').append(ul); + }); + } }; -- 2.11.0