Operate dragging of pinned tabs (not faviconized) correctly

This commit is contained in:
Piro / YUKI Hiroshi 2012-12-04 00:28:23 +09:00
parent 1d2566765d
commit 8511c0e9ce
2 changed files with 15 additions and 6 deletions

View File

@ -15,7 +15,7 @@
http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js
*/ */
(function() { (function() {
const currentRevision = 23; const currentRevision = 24;
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
@ -333,9 +333,18 @@
{ {
var context = {}; var context = {};
context.draggedTabs = this.getDraggedTabs(aEvent);
context.draggedTab = context.draggedTabs[0];
if (typeof aOptions == 'boolean') aOptions = { canDropOnSelf: aOptions }; if (typeof aOptions == 'boolean') aOptions = { canDropOnSelf: aOptions };
context.options = 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 tabbar = this.getTabbarFromEvent(aEvent);
var isVertical = 'isVertical' in context.options ? var isVertical = 'isVertical' in context.options ?
@ -347,9 +356,6 @@
context.translator = isVertical ? 'translateY' : 'translateX' ; context.translator = isVertical ? 'translateY' : 'translateX' ;
context.currentX = aEvent[context.position]; context.currentX = aEvent[context.position];
context.draggedTabs = this.getDraggedTabs(aEvent);
context.draggedTab = context.draggedTabs[0];
context.tabWidth = context.draggedTab.getBoundingClientRect()[context.size]; context.tabWidth = context.draggedTab.getBoundingClientRect()[context.size];
context.tabCenterOffset = context.tabWidth / (context.options.canDropOnSelf ? 3 : 2 ); context.tabCenterOffset = context.tabWidth / (context.options.canDropOnSelf ? 3 : 2 );

View File

@ -877,7 +877,10 @@ try{
canDropOnSelf : !dragOverTab || !dragOverTab.pinned, canDropOnSelf : !dragOverTab || !dragOverTab.pinned,
isVertical : ( isVertical : (
b.ownerDocument.defaultView['piro.sakura.ne.jp'].tabsDragUtils.isVertical(b.tabContainer) && b.ownerDocument.defaultView['piro.sakura.ne.jp'].tabsDragUtils.isVertical(b.tabContainer) &&
!draggedTab.pinned (
!draggedTab.pinned ||
!utils.getTreePref('pinnedTab.faviconized')
)
) )
}); });