зеркало из https://github.com/mozilla/pjs.git
Bug 353698 - Make sure to announce the fact that a selected event was deleted. r=lilmatt, mvl
This commit is contained in:
Родитель
11803f58ca
Коммит
3ff1065a37
|
@ -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);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче