fix for bug #334244: Click-drag-release on bookmarks toolbar folder drags the folder

patch=Steve Won <swon@mozilla.com>

r=dietrich
This commit is contained in:
sspitzer@mozilla.org 2007-07-06 18:12:37 -07:00
parent d610c681d0
commit a2f891b8b3

View File

@ -789,20 +789,25 @@
},
onDragStart: function TBV_DO_onDragStart(event, xferData, dragAction) {
if (event.target.localName == "toolbarbutton" &&
event.target.getAttribute("type") == "menu") {
#ifdef XP_WIN
// Support folder dragging on the personal toolbar when the user
// holds the "alt" key while they drag (Ctrl+drag has another
// meaning - Copy). This does not appear to work at all on Linux.
if (!event.shiftKey && !event.altKey && !event.ctrlKey)
return false;
event.target.firstChild.hidePopup();
#else
return;
#endif
}
if (event.ctrlKey) {
dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY;
}
xferData.data = this._self._controller.getTransferData(dragAction.action);
#ifdef XP_WIN
// Support folder dragging on the personal toolbar when the user
// holds the "alt" key while they drag (Ctrl+drag has another
// meaning - Copy). This does not appear to work at all on Linux.
if (event.target.localName == "toolbarbutton" &&
event.target.getAttribute("type") == "menu") {
if (!event.shiftKey && !event.altKey && !event.ctrlKey)
return false;
event.target.firstChild.hidePopup();
}
return true;
#endif
},