From 83f05211814713778b5206b61f171a27ebd1cc8c Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 12 Feb 2010 15:07:46 +0100 Subject: [PATCH] Create all-day event when clicking in the all-day row. --- kronolith/js/kronolith.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 00822ea5c..6d3c0a5ed 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -459,6 +459,7 @@ KronolithCore = { this.dayGroups = []; this.allDayEvents = []; $('kronolithViewDay').down('caption span').innerHTML = this.setTitle(date.toString('D')); + $('kronolithViewDay').down('.kronolithAllDayContainer').writeAttribute('id', 'kronolithEventsDay' + date.dateString()); break; case 'week': @@ -2828,7 +2829,12 @@ KronolithCore = { return; case 'kronolithEventsWeek': - this.go('event:' + elt.identify().substr(elt.identify().length - 8)); + case 'kronolithAllDayContainer': + var date = elt.identify().substr(elt.identify().length - 8); + if (elt.className == 'kronolithAllDayContainer') { + date += 'all'; + } + this.go('event:' + date); e.stop(); return; } @@ -3229,6 +3235,7 @@ KronolithCore = { }.bind(this); this.updateCalendarDropDown('kronolithEventTarget'); + this.toggleAllDay(false); $('kronolithEventForm').enable(); $('kronolithEventForm').reset(); $('kronolithEventSave').show(); @@ -3240,7 +3247,17 @@ KronolithCore = { this.doAction('GetEvent', { 'cal': calendar, 'id': id, 'date': date }, this._editEvent.bind(this)); } else { $('kronolithEventTags').autocompleter.init(); - var d = date ? this.parseDate(date) : new Date(); + var d; + if (date) { + if (date.endsWith('all')) { + date = date.substring(0, date.length - 3); + $('kronolithEventAllday').setValue(true); + this.toggleAllDay(true); + } + d = this.parseDate(date); + } else { + d = new Date(); + } $('kronolithEventId').clear(); $('kronolithEventCalendar').clear(); $('kronolithEventTarget').setValue(Kronolith.conf.default_calendar); -- 2.11.0