From 6b571210d7586fabb6d4d9c4ceac2f8bea8709a9 Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Fri, 1 Jul 2005 00:57:28 +0000 Subject: [PATCH] fix editing recurrence exceptions in dialog, r=pav --- calendar/base/content/calendar-recurrence-dialog.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/calendar/base/content/calendar-recurrence-dialog.js b/calendar/base/content/calendar-recurrence-dialog.js index d6086cb1e4d8..68b39e803a7f 100644 --- a/calendar/base/content/calendar-recurrence-dialog.js +++ b/calendar/base/content/calendar-recurrence-dialog.js @@ -146,6 +146,13 @@ function loadDialog() function saveDialog() { + // This works, but if we ever support more complex recurrence, + // e.g. recurrence for Martians, then we're going to want to + // not clone and just recreate the recurrenceInfo each time. + // The reason is that the order of items (rules/dates/datesets) + // matters, so we can't always just append at the end. This + // code here always inserts a rule first, because all our + // exceptions should come afterward. var deckNumber = Number(getElementValue("period-list")); var recurrenceInfo = null; @@ -208,8 +215,7 @@ function saveDialog() break; } - recurrenceInfo.appendRecurrenceItem(recRule); - + recurrenceInfo.insertRecurrenceItemAt(recRule, 0); for each (date in window.removedExceptions) { recurrenceInfo.restoreOccurrenceAt(date);