Bug 343190 ��� DnD month view: Drag and Drop stops working if event is dropped out of calendar view, r=lilmatt, mvl

This commit is contained in:
jminta%gmail.com 2006-12-28 01:19:50 +00:00
Родитель 75d379ec24
Коммит c7b64e86a2
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -162,6 +162,28 @@
}
this.parentBox.addDropShadows();
// Mozilla doesn't provide any generic way for us to listen for the
// drag-end. Add this listener for a best approximation of listening
// for that case.
var monthbox = this.parentBox;
monthbox.monthView.dropListener = function checkStillDragging() {
var dragService = Components.classes["@mozilla.org/widget/dragservice;1"]
.getService(Components.interfaces.nsIDragService);
var session;
try {
session = dragService.getCurrentSession();
} catch (ex) {}
if (!session) {
monthbox.removeDropShadows();
monthbox.addItem(item);
window.removeEventListener("mouseover",
monthbox.monthView.dropListener,
true);
}
};
window.addEventListener("mouseover",
monthbox.monthView.dropListener, true);
dragService.invokeDragSession(this, supArray, null, action);
]]></handler>
</handlers>
@ -577,6 +599,10 @@
}
this.removeDropShadows();
window.removeEventListener("mouseover",
this.monthView.dropListener, true);
this.monthView.controller.modifyOccurrence(item, newStart, newEnd);
]]></handler>
</handlers>