diff --git a/calendar/base/content/calendar-month-view.xml b/calendar/base/content/calendar-month-view.xml index bc55df4c4be..a72f433f09d 100644 --- a/calendar/base/content/calendar-month-view.xml +++ b/calendar/base/content/calendar-month-view.xml @@ -1357,11 +1357,18 @@ function isNotItem(a) { return !a.hasSameIds(aItem); } + var oldLength = this.mSelectedItems.length; this.mSelectedItems = this.mSelectedItems.filter(isNotItem); for each (box in boxes) { box.box.deleteItem(aItem); } + + // If a deleted event was selected, we need to announce that the + // selection changed. + if (oldLength != this.mSelectedItems.length) { + this.fireEvent("itemselect", this.mSelectedItems); + } ]]> diff --git a/calendar/base/content/calendar-multiday-view.xml b/calendar/base/content/calendar-multiday-view.xml index 489c286b1ae..e42b92b83d1 100644 --- a/calendar/base/content/calendar-multiday-view.xml +++ b/calendar/base/content/calendar-multiday-view.xml @@ -2642,6 +2642,19 @@ column.deleteEvent(aEvent); } } + + // See whether the item we are deleting was selected. If it was, then + // fire the appropriate event so our watchers can update + var found = false; + for (var i = 0; i < this.mSelectedItems.length; i++) { + if (this.mSelectedItems[i].hasSameIds(aEvent)) { + this.mSelectedItems.splice(i, 1); + found = true; + } + } + if (found) { + this.fireEvent("itemselect", this.mSelectedItems); + } ]]>