From 5a97196b49640117c546ad59cbfa31f974259f0b Mon Sep 17 00:00:00 2001 From: James Lal Date: Sun, 8 Jul 2012 13:51:20 -0700 Subject: defaults for calendar query will now return data --- lib/caldav/templates/calendar_data.js | 10 +++++++++- lib/caldav/templates/calendar_filter.js | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/caldav/templates/calendar_data.js b/lib/caldav/templates/calendar_data.js index 2c24569..5fcc4e8 100644 --- a/lib/caldav/templates/calendar_data.js +++ b/lib/caldav/templates/calendar_data.js @@ -18,6 +18,10 @@ * @param {String} type iCal fieldset (VTODO, VEVENT,...). */ select: function(type, list) { + if (typeof(list) === 'undefined') { + list = true; + } + var struct = this.struct; this._hasItems = true; @@ -71,6 +75,10 @@ return output; }, + _defaultRender: function(template) { + return template.tag(['caldav', this.rootName]); + }, + /** * Renders CalendarData with a template. * @@ -79,7 +87,7 @@ */ render: function(template) { if (!this._hasItems) { - return template.tag(['caldav', this.rootName]); + return this._defaultRender(template); } var struct = this.struct; diff --git a/lib/caldav/templates/calendar_filter.js b/lib/caldav/templates/calendar_filter.js index aebd9fe..a16f985 100644 --- a/lib/caldav/templates/calendar_filter.js +++ b/lib/caldav/templates/calendar_filter.js @@ -12,6 +12,11 @@ add: CalendarData.prototype.select, + _defaultRender: function(template) { + var inner = this._renderFieldset(template, { VCALENDAR: [{ VEVENT: true }] }); + return template.tag(['caldav', this.rootName], inner); + }, + compName: 'comp-filter', rootName: 'filter' }; -- cgit