contentAreaDNDObserverを使わずに、コンテンツ領域へのタブバーのドロップをハンドリングするようにした( https://bugzilla.mozilla.org/show_bug.cgi?id=545714 の変更への追従)

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6599 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-04-21 13:22:07 +00:00
parent 1985fe3220
commit 5ad661b1ff
2 changed files with 16 additions and 17 deletions

View File

@ -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;',
<![CDATA[$&
if (gBrowser.treeStyleTab.panelDNDObserver.canDrop(aEvent, gBrowser.treeStyleTab.getCurrentDragSession())) {
return gBrowser.treeStyleTab.panelDNDObserver.onDrop(aEvent, null, gBrowser.treeStyleTab.getCurrentDragSession());
}
]]>
)
);
}
if ('PrintUtils' in window) {
eval('PrintUtils.printPreview = '+PrintUtils.printPreview.toSource().replace(
'{',

View File

@ -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))