Restore opacity of dragged tabs correctly

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-13 03:05:48 +09:00
parent 5dec3a90ce
commit c1770fe9f0

View File

@ -606,7 +606,13 @@ catch(e) {
aTab.removeAttribute(sv.kDROP_POSITION) aTab.removeAttribute(sv.kDROP_POSITION)
// clear drop position preview on Firefox 17 and later // clear drop position preview on Firefox 17 and later
if (aOnFinish) aTab.style.transform = ''; if (aOnFinish) {
aTab.style.transform = '';
if (aTab.__treestyletab__opacityBeforeDragged) {
aTab.style.opacity = aTab.__treestyletab__opacityBeforeDragged;
delete aTab.__treestyletab__opacityBeforeDragged;
}
}
}); });
if (aOnFinish) if (aOnFinish)
@ -827,10 +833,6 @@ catch(e) {
if (eX > x && eX < x + w && eY > y && eY < y + h) if (eX > x && eX < x + w && eY > y && eY < y + h)
return; return;
this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(dt).forEach(function(aTab) {
aTab.style.opacity = '';
});
var draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0); var draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
if (this.isDraggingAllCurrentTabs(draggedTab)) if (this.isDraggingAllCurrentTabs(draggedTab))
return; return;
@ -940,6 +942,8 @@ try{
.canAnimateDraggedTabs(aEvent)) { // Firefox 17 and later .canAnimateDraggedTabs(aEvent)) { // Firefox 17 and later
let newOpacity = dropPosition == 'self' ? 0.5 : '' ; // to prevent the dragged tab hides the drop target itself let newOpacity = dropPosition == 'self' ? 0.5 : '' ; // to prevent the dragged tab hides the drop target itself
this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(aEvent).forEach(function(aTab) { this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(aEvent).forEach(function(aTab) {
if (!('__treestyletab__opacityBeforeDragged' in aTab))
aTab.__treestyletab__opacityBeforeDragged = aTab.style.opacity || '';
aTab.style.opacity = newOpacity; aTab.style.opacity = newOpacity;
}); });
} }
@ -1003,9 +1007,6 @@ catch(e) {
aEvent.stopPropagation(); aEvent.stopPropagation();
return; return;
} }
this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(dt).forEach(function(aTab) {
aTab.style.opacity = '';
});
var sourceBrowser = sv.getTabBrowserFromChild(draggedTab); var sourceBrowser = sv.getTabBrowserFromChild(draggedTab);
if (draggedTab && sourceBrowser != b) if (draggedTab && sourceBrowser != b)