From: Michael J. Rubinsky Date: Thu, 18 Nov 2010 06:26:44 +0000 (-0500) Subject: Initial go at showing a clicked day's events on the monthview. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8506fddee0268c4aee353fc50f338cfa7ce70273;p=horde.git Initial go at showing a clicked day's events on the monthview. --- 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); + }); + } };