From 10555d3140c4abed84bdf135e7b58ca58659a6ae Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 2 Jul 2010 03:39:31 +0000 Subject: [PATCH] =?UTF-8?q?Minefield=204.0b2pre=E3=81=A7=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=81=AE=E4=B8=8A=E3=81=A7=E3=82=B3=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=82=92=E9=96=8B=E3=81=91=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=81=AB=E5=AF=BE=E5=87=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6799 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 69 ++++++++++++--------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index b8e08e56..8d6abf76 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -285,15 +285,16 @@ TreeStyleTabBrowser.prototype = { b.mTabContainer.addEventListener('dblclick', this, true); b.mTabContainer.addEventListener('select', this, true); b.mTabContainer.addEventListener('scroll', this, true); - strip.addEventListener('dragstart', this, false); - strip.addEventListener('dragenter', this, false); - strip.addEventListener('dragleave', this, false); - strip.addEventListener('dragend', this, false); - strip.addEventListener('dragover', this, false); - strip.addEventListener('drop', this, false); - strip.addEventListener('mousedown', this, true); - strip.addEventListener('mouseup', this, false); - strip.addEventListener('click', this, true); + strip.addEventListener('dragstart', this, false); + strip.addEventListener('dragenter', this, false); + strip.addEventListener('dragleave', this, false); + strip.addEventListener('dragend', this, false); + strip.addEventListener('dragover', this, false); + strip.addEventListener('drop', this, false); + strip.addEventListener('MozMouseHittest', this, true); // to block default behaviors of the tab bar + strip.addEventListener('mousedown', this, true); + strip.addEventListener('mouseup', this, false); + strip.addEventListener('click', this, true); b.mPanelContainer.addEventListener('dragleave', this, false); b.mPanelContainer.addEventListener('dragover', this, false); b.mPanelContainer.addEventListener('drop', this, true); @@ -1514,15 +1515,16 @@ TreeStyleTabBrowser.prototype = { b.mTabContainer.removeEventListener('dblclick', this, true); b.mTabContainer.removeEventListener('select', this, true); b.mTabContainer.removeEventListener('scroll', this, true); - strip.removeEventListener('dragstart', this, false); - strip.removeEventListener('dragenter', this, false); - strip.removeEventListener('dragleave', this, false); - strip.removeEventListener('dragend', this, false); - strip.removeEventListener('dragover', this, false); - strip.removeEventListener('drop', this, false); - strip.removeEventListener('mousedown', this, true); - strip.removeEventListener('mouseup', this, false); - strip.removeEventListener('click', this, true); + strip.removeEventListener('dragstart', this, false); + strip.removeEventListener('dragenter', this, false); + strip.removeEventListener('dragleave', this, false); + strip.removeEventListener('dragend', this, false); + strip.removeEventListener('dragover', this, false); + strip.removeEventListener('drop', this, false); + strip.removeEventListener('MozMouseHittest', this, true); + strip.removeEventListener('mousedown', this, true); + strip.removeEventListener('mouseup', this, false); + strip.removeEventListener('click', this, true); b.mPanelContainer.removeEventListener('dragleave', this, false); b.mPanelContainer.removeEventListener('dragover', this, false); b.mPanelContainer.removeEventListener('drop', this, true); @@ -1827,6 +1829,9 @@ TreeStyleTabBrowser.prototype = { case 'dblclick': return this.onDblClick(aEvent); + case 'MozMouseHittest': // to block default behaviors of the tab bar + return this.onMozMouseHittest(aEvent); + case 'mousedown': return this.onMouseDown(aEvent); @@ -2909,6 +2914,22 @@ TreeStyleTabBrowser.prototype = { } }, + onMozMouseHittest : function TSTBrowser_onMozMouseHittest(aEvent) + { + // block default behaviors of the tab bar (dragging => window move, etc.) + if ( + 'TabsOnTop' in window && + ( + this.currentTabbarPosition != 'top' || + !TabsOnTop.enabled || + aEvent.shiftKey + ) && + this.tabbarDNDObserver.canDragTabbar(aEvent) + ) { + aEvent.stopPropagation(); + } + }, + onMouseDown : function TSTBrowser_onMouseDown(aEvent) { if ( @@ -2917,16 +2938,8 @@ TreeStyleTabBrowser.prototype = { ) { this.getTabFromEvent(aEvent).__treestyletab__preventSelect = true; } - else if ( - 'TabsOnTop' in window && - !this.getTabFromEvent(aEvent) && - ( - this.currentTabbarPosition != 'top' || - !TabsOnTop.enabled - ) && - this.tabbarDNDObserver.canDragTabbar(aEvent) - ) { - aEvent.stopPropagation(); + else { + this.onMozMouseHittest(aEvent); } },