From 8511c0e9ce195d13697077065ce5e8dd84f74bbd Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Tue, 4 Dec 2012 00:28:23 +0900 Subject: [PATCH] Operate dragging of pinned tabs (not faviconized) correctly --- content/treestyletab/res/tabsDragUtils.js | 16 +++++++++++----- modules/tabbarDNDObserver.js | 5 ++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/res/tabsDragUtils.js b/content/treestyletab/res/tabsDragUtils.js index 0007d4b8..06aba5c6 100644 --- a/content/treestyletab/res/tabsDragUtils.js +++ b/content/treestyletab/res/tabsDragUtils.js @@ -15,7 +15,7 @@ http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js */ (function() { - const currentRevision = 23; + const currentRevision = 24; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; @@ -333,9 +333,18 @@ { var context = {}; + context.draggedTabs = this.getDraggedTabs(aEvent); + context.draggedTab = context.draggedTabs[0]; + if (typeof aOptions == 'boolean') aOptions = { canDropOnSelf: aOptions }; context.options = aOptions || {}; - context.options.canDropOnSelf = context.options.canDropOnSelf || ('TreeStyleTabService' in window); + context.options.canDropOnSelf = ( + context.options.canDropOnSelf || + ( + 'TreeStyleTabService' in window && + !context.draggedTab.pinned + ) + ); var tabbar = this.getTabbarFromEvent(aEvent); var isVertical = 'isVertical' in context.options ? @@ -347,9 +356,6 @@ context.translator = isVertical ? 'translateY' : 'translateX' ; context.currentX = aEvent[context.position]; - context.draggedTabs = this.getDraggedTabs(aEvent); - context.draggedTab = context.draggedTabs[0]; - context.tabWidth = context.draggedTab.getBoundingClientRect()[context.size]; context.tabCenterOffset = context.tabWidth / (context.options.canDropOnSelf ? 3 : 2 ); diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index c86dc847..378f1886 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -877,7 +877,10 @@ try{ canDropOnSelf : !dragOverTab || !dragOverTab.pinned, isVertical : ( b.ownerDocument.defaultView['piro.sakura.ne.jp'].tabsDragUtils.isVertical(b.tabContainer) && - !draggedTab.pinned + ( + !draggedTab.pinned || + !utils.getTreePref('pinnedTab.faviconized') + ) ) });