author | Tim Taubert <tim.taubert@gmx.de> |
Wed, 08 Feb 2012 02:46:20 +0100 | |
changeset 86421 | 097b38220aa7c134d97bbeb4cf8febfa9b229264 |
parent 86313 | e0d9c8ddd5bd31cfc5481d47945ffe6e62009704 |
child 86422 | 250f556a5d49f67985880370baee1e9ad2de1f56 |
push id | 22019 |
push user | tim.taubert@gmx.de |
push date | Thu, 09 Feb 2012 08:29:49 +0000 |
treeherder | mozilla-central@ca84ab42bd5b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | fryn |
bugs | 721417 |
milestone | 13.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/browser/base/content/newtab/page.js +++ b/browser/base/content/newtab/page.js @@ -82,20 +82,21 @@ let gPage = { this.updateModifiedFlag(); // Initialize and render the grid. gGrid.init(this._gridSelector); // Initialize the drop target shim. gDropTargetShim.init(); +#ifdef XP_MACOSX // Workaround to prevent a delay on MacOSX due to a slow drop animation. - let doc = document.documentElement; - doc.addEventListener("dragover", this.onDragOver, false); - doc.addEventListener("drop", this.onDrop, false); + document.addEventListener("dragover", this.onDragOver, false); + document.addEventListener("drop", this.onDrop, false); +#endif }.bind(this)); }, /** * Updates the 'page-disabled' attributes of the respective DOM nodes. * @param aValue Whether to set or remove attributes. */ _updateAttributes: function Page_updateAttributes(aValue) { @@ -150,24 +151,24 @@ let gPage = { }, /** * Handles the 'dragover' event. Workaround to prevent a delay on MacOSX * due to a slow drop animation. * @param aEvent The 'dragover' event. */ onDragOver: function Page_onDragOver(aEvent) { - if (gDrag.isValid(aEvent)) + if (gDrag.isValid(aEvent) && gDrag.draggedSite) aEvent.preventDefault(); }, /** * Handles the 'drop' event. Workaround to prevent a delay on MacOSX due to * a slow drop animation. * @param aEvent The 'drop' event. */ onDrop: function Page_onDrop(aEvent) { - if (gDrag.isValid(aEvent)) { + if (gDrag.isValid(aEvent) && gDrag.draggedSite) { aEvent.preventDefault(); aEvent.stopPropagation(); } } };