Make transparent dragged tabs when they are going to be dropped onto a tab

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-13 02:56:02 +09:00
parent 0db8f5f765
commit 5dec3a90ce

View File

@ -827,8 +827,11 @@ 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);
draggedTab.style.opacity = '';
if (this.isDraggingAllCurrentTabs(draggedTab)) if (this.isDraggingAllCurrentTabs(draggedTab))
return; return;
@ -935,11 +938,10 @@ try{
indicatorTab.setAttribute(sv.kDROP_POSITION, dropPosition); indicatorTab.setAttribute(sv.kDROP_POSITION, dropPosition);
if (b.ownerDocument.defaultView['piro.sakura.ne.jp'].tabsDragUtils if (b.ownerDocument.defaultView['piro.sakura.ne.jp'].tabsDragUtils
.canAnimateDraggedTabs(aEvent)) { // Firefox 17 and later .canAnimateDraggedTabs(aEvent)) { // Firefox 17 and later
if (dropPosition == 'self') { let newOpacity = dropPosition == 'self' ? 0.5 : '' ; // to prevent the dragged tab hides the drop target itself
draggedTab.style.opacity = 0.5; // to prevent the dragged tab hides the drop target itself this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(aEvent).forEach(function(aTab) {
} else { aTab.style.opacity = newOpacity;
draggedTab.style.opacity = ''; });
}
} }
} }
@ -1001,8 +1003,9 @@ catch(e) {
aEvent.stopPropagation(); aEvent.stopPropagation();
return; return;
} }
if (draggedTab) this.window['piro.sakura.ne.jp'].tabsDragUtils.getDraggedTabs(dt).forEach(function(aTab) {
draggedTab.style.opacity = ''; aTab.style.opacity = '';
});
var sourceBrowser = sv.getTabBrowserFromChild(draggedTab); var sourceBrowser = sv.getTabBrowserFromChild(draggedTab);
if (draggedTab && sourceBrowser != b) if (draggedTab && sourceBrowser != b)