diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 89f32aa4..62acee0b 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1125,20 +1125,6 @@ catch(e) { ) ); - if (window.contentAreaDNDObserver && - !('getSupportedFlavours' in contentAreaDNDObserver)) { // Firefox 3.6 or later - eval('contentAreaDNDObserver.onDrop = '+ - contentAreaDNDObserver.onDrop.toSource().replace( - 'var types = aEvent.dataTransfer.types;', - - ) - ); - } - if ('PrintUtils' in window) { eval('PrintUtils.printPreview = '+PrintUtils.printPreview.toSource().replace( '{', diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 7f38d2c2..9c7bcabf 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -230,7 +230,8 @@ TreeStyleTabBrowser.prototype = { strip.addEventListener('click', this, true); b.mPanelContainer.addEventListener('dragexit', this, false); b.mPanelContainer.addEventListener('dragover', this, false); - b.mPanelContainer.addEventListener('dragdrop', this, false); + b.mPanelContainer.addEventListener('drop', this, true); + b.mPanelContainer.addEventListener('dragdrop', this, false); // for Firefox 3.5 or older if (this.isFloating) window.addEventListener('resize', this, true); @@ -1344,7 +1345,8 @@ TreeStyleTabBrowser.prototype = { strip.removeEventListener('click', this, true); b.mPanelContainer.removeEventListener('dragexit', this, false); b.mPanelContainer.removeEventListener('dragover', this, false); - b.mPanelContainer.removeEventListener('dragdrop', this, false); + b.mPanelContainer.removeEventListener('drop', this, true); + b.mPanelContainer.removeEventListener('dragdrop', this, false); // for Firefox 3.5 or older if (this.isFloating) window.removeEventListener('resize', this, true); @@ -1647,7 +1649,7 @@ TreeStyleTabBrowser.prototype = { observer = this.tabbarDNDObserver; canDrop = true; } - else { + else { // for Firefox 3.5 or older observer = this.panelDNDObserver; canDrop = observer.canDrop(aEvent, this.getCurrentDragSession()); } @@ -1658,6 +1660,17 @@ TreeStyleTabBrowser.prototype = { } return; + // drop on panelContainer + case 'drop': + let (session = this.getCurrentDragSession()) { + if (this.panelDNDObserver.canDrop(aEvent, session)) { + this.panelDNDObserver.onDrop(aEvent, null, session); + aEvent.preventDefault(); + aEvent.stopPropagation(); + } + } + return; + case 'mouseover': if (this.isEventFiredOnTwisty(aEvent))