From 8ceee21ec9ed5ba9af6e499325eb760717e2f519 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Tue, 13 Sep 2016 12:52:32 +0900 Subject: [PATCH] Don't turn the mode of "+" button in the tab bar while dragging --- content/treestyletab/res/tabsDragUtils.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/res/tabsDragUtils.js b/content/treestyletab/res/tabsDragUtils.js index d35a08db..df17e194 100644 --- a/content/treestyletab/res/tabsDragUtils.js +++ b/content/treestyletab/res/tabsDragUtils.js @@ -635,8 +635,10 @@ TDUContext.destroy(); aEvent.stopPropagation(); if (aOptions.shrinkOthers) { - document.addEventListener('dragend', this, true); - document.addEventListener('drop', this, true); + document.addEventListener('dragend', this, true); + document.addEventListener('drop', this, true); + document.addEventListener('overflow', this, true); + document.addEventListener('underflow', this, true); } }, isVertical : function TDS_isVertical(aElement) @@ -891,7 +893,17 @@ TDUContext.destroy(); case 'drop': document.removeEventListener('dragend', this, true); document.removeEventListener('drop', this, true); + document.removeEventListener('overflow', this, true); + document.removeEventListener('underflow', this, true); return this.clearDraggingStyles(aEvent); + + case 'overflow': + case 'underflow': + if (aEvent.target.localName == 'tab') { + // this must be canceled to prevent the "+" button in the tab bar turns its mode. + aEvent.stopPropagation(); + } + return; } },