内容領域へのドロップが無視される問題を回避
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4997 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
fe2cea740d
commit
d7b0bdd930
@ -149,7 +149,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.addEventListener('mousedown', this, true);
|
b.mTabContainer.addEventListener('mousedown', this, true);
|
||||||
b.mTabContainer.addEventListener('select', this, true);
|
b.mTabContainer.addEventListener('select', this, true);
|
||||||
b.mTabContainer.addEventListener('scroll', this, true);
|
b.mTabContainer.addEventListener('scroll', this, true);
|
||||||
b.mPanelContainer.addEventListener('dragenter', this, false);
|
|
||||||
b.mPanelContainer.addEventListener('dragexit', this, false);
|
b.mPanelContainer.addEventListener('dragexit', this, false);
|
||||||
b.mPanelContainer.addEventListener('dragover', this, false);
|
b.mPanelContainer.addEventListener('dragover', this, false);
|
||||||
b.mPanelContainer.addEventListener('dragdrop', this, false);
|
b.mPanelContainer.addEventListener('dragdrop', this, false);
|
||||||
@ -1028,7 +1027,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
b.mTabContainer.removeEventListener('mousedown', this, true);
|
b.mTabContainer.removeEventListener('mousedown', this, true);
|
||||||
b.mTabContainer.removeEventListener('select', this, true);
|
b.mTabContainer.removeEventListener('select', this, true);
|
||||||
b.mTabContainer.removeEventListener('scroll', this, true);
|
b.mTabContainer.removeEventListener('scroll', this, true);
|
||||||
b.mPanelContainer.removeEventListener('dragenter', this, false);
|
|
||||||
b.mPanelContainer.removeEventListener('dragexit', this, false);
|
b.mPanelContainer.removeEventListener('dragexit', this, false);
|
||||||
b.mPanelContainer.removeEventListener('dragover', this, false);
|
b.mPanelContainer.removeEventListener('dragover', this, false);
|
||||||
b.mPanelContainer.removeEventListener('dragdrop', this, false);
|
b.mPanelContainer.removeEventListener('dragdrop', this, false);
|
||||||
@ -1336,17 +1334,13 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.onPopupShowing(aEvent);
|
this.onPopupShowing(aEvent);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
case 'draggesture':
|
case 'draggesture':
|
||||||
nsDragAndDrop.startDrag(aEvent, this.tabbarDNDObserver);
|
nsDragAndDrop.startDrag(aEvent, this.tabbarDNDObserver);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'dragenter':
|
case 'dragenter':
|
||||||
nsDragAndDrop.dragEnter(
|
nsDragAndDrop.dragEnter(aEvent, this.tabbarDNDObserver);
|
||||||
aEvent,
|
|
||||||
aEvent.currentTarget == this.mTabBrowser.mStrip ?
|
|
||||||
this.tabbarDNDObserver :
|
|
||||||
this.panelDNDObserver
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'dragexit':
|
case 'dragexit':
|
||||||
@ -1363,22 +1357,23 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case 'dragover':
|
case 'dragover':
|
||||||
nsDragAndDrop.dragOver(
|
case 'dragdrop':
|
||||||
aEvent,
|
let (canDrop, observer) {
|
||||||
aEvent.currentTarget == this.mTabBrowser.mStrip ?
|
if (aEvent.currentTarget == this.mTabBrowser.mStrip) {
|
||||||
this.tabbarDNDObserver :
|
observer = this.tabbarDNDObserver;
|
||||||
this.panelDNDObserver
|
canDrop = true;
|
||||||
);
|
}
|
||||||
|
else {
|
||||||
|
observer = this.panelDNDObserver;
|
||||||
|
canDrop = observer.canDrop(aEvent, this.getCurrentDragSession());
|
||||||
|
}
|
||||||
|
// don't use nsDragAndDrop if it can't be dropped!!
|
||||||
|
// http://piro.sakura.ne.jp/latest/blosxom/mozilla/xul/2007-02-02_splitbrowser-dragdrop.htm
|
||||||
|
if (canDrop)
|
||||||
|
nsDragAndDrop[aEvent.type == 'dragover' ? 'dragOver' : 'drop' ](aEvent, observer);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'dragdrop':
|
|
||||||
nsDragAndDrop.drop(
|
|
||||||
aEvent,
|
|
||||||
aEvent.currentTarget == this.mTabBrowser.mStrip ?
|
|
||||||
this.tabbarDNDObserver :
|
|
||||||
this.panelDNDObserver
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
|
|
||||||
case 'mouseover':
|
case 'mouseover':
|
||||||
if (this.isEventFiredOnTwisty(aEvent))
|
if (this.isEventFiredOnTwisty(aEvent))
|
||||||
@ -2460,10 +2455,6 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this._panelDNDObserver = {
|
this._panelDNDObserver = {
|
||||||
mOwner : this,
|
mOwner : this,
|
||||||
|
|
||||||
onDragEnter : function(aEvent, aDragSession)
|
|
||||||
{
|
|
||||||
},
|
|
||||||
|
|
||||||
onDragExit : function(aEvent, aDragSession)
|
onDragExit : function(aEvent, aDragSession)
|
||||||
{
|
{
|
||||||
if (!this.canDrop(aEvent, aDragSession)) return;
|
if (!this.canDrop(aEvent, aDragSession)) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user