mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 18:31:08 +00:00
Bug 348500 error when press cancel in dialog 'Editing a repeating item' for recurrence event, patch by ssitter, r1=lilmatt, r2=jminta
This commit is contained in:
parent
e5981b9e2d
commit
3a7e5a014c
@ -180,6 +180,7 @@ function openEventDialog(calendarItem, calendar, mode, callback)
|
||||
// whether the user wants to edit all instances, or just this one. This
|
||||
// function prompts this question (if the item is actually an instance of a
|
||||
// recurring event) and returns the appropriate item that should be modified.
|
||||
// Returns null if the prompt was cancelled.
|
||||
function getOccurrenceOrParent(occurrence) {
|
||||
// Check if this actually is an instance of a recurring event
|
||||
if (occurrence == occurrence.parentItem) {
|
||||
|
@ -94,6 +94,9 @@ var calendarViewController = {
|
||||
var itemToEdit;
|
||||
if (aNewStartTime && aNewEndTime) {
|
||||
itemToEdit = getOccurrenceOrParent(aOccurrence);
|
||||
if (!itemToEdit) {
|
||||
return;
|
||||
}
|
||||
var instance = itemToEdit.clone();
|
||||
|
||||
// if we're about to modify the parentItem, we need to account
|
||||
@ -143,6 +146,9 @@ var calendarViewController = {
|
||||
|
||||
deleteOccurrence: function (aOccurrence) {
|
||||
var itemToDelete = getOccurrenceOrParent(aOccurrence);
|
||||
if (!itemToDelete) {
|
||||
return;
|
||||
}
|
||||
if (!itemToDelete.parentItem.hasSameIds(itemToDelete)) {
|
||||
var event = itemToDelete.parentItem.clone();
|
||||
event.recurrenceInfo.removeOccurrenceAt(itemToDelete.recurrenceId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user