From 49810b0f317483d2ec2f25df29117d555efc4ac4 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sat, 13 Oct 2012 03:16:08 +0900 Subject: [PATCH] Restore opacity of dragged tabs correctly (again) --- modules/tabbarDNDObserver.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index c6712165..ce32cf85 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -336,10 +336,15 @@ catch(e) { var sizeProp = sv.isVertical && pinned ? sv.invertedSizeProp : sv.sizeProp ; var boxPos = sv.getTabActualScreenPosition(tab); var boxUnit = Math.round(tab.boxObject[sizeProp] / dropAreasCount); - if (aEvent[screenPositionProp] < boxPos + boxUnit) { + var eventPosition = aEvent[screenPositionProp]; +// if (this.window['piro.sakura.ne.jp'].tabsDragUtils +// .canAnimateDraggedTabs(aEvent)) { +// eventPosition = Math.round(sv.getTabActualScreenPosition(draggedTab) + (tab.boxObject[sizeProp] / 2)) +// } + if (eventPosition < boxPos + boxUnit) { info.position = isInverted ? sv.kDROP_AFTER : sv.kDROP_BEFORE ; } - else if (dropAreasCount == 2 || aEvent[screenPositionProp] > boxPos + boxUnit + boxUnit) { + else if (dropAreasCount == 2 || eventPosition > boxPos + boxUnit + boxUnit) { info.position = isInverted ? sv.kDROP_BEFORE : sv.kDROP_AFTER ; } else { @@ -608,7 +613,7 @@ catch(e) { // clear drop position preview on Firefox 17 and later if (aOnFinish) { aTab.style.transform = ''; - if (aTab.__treestyletab__opacityBeforeDragged) { + if ('__treestyletab__opacityBeforeDragged' in aTab) { aTab.style.opacity = aTab.__treestyletab__opacityBeforeDragged; delete aTab.__treestyletab__opacityBeforeDragged; }