Handle hidden/collapsed tabs while tab dragging correctly

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-13 02:43:34 +09:00
parent d66b7083d2
commit 0db8f5f765
2 changed files with 11 additions and 10 deletions

View File

@ -131,6 +131,8 @@
'if (!("animLastScreenX" in draggedTab._dragData))',
'let tabsWidth = 0;\n' +
'draggedTabs.forEach(function(draggedTab) {\n' +
' let style = window.getComputedStyle(draggedTab, null);\n' +
' if (style.visibility != "collapse" && style.display != "none")\n' +
' tabsWidth += draggedTab.boxObject[size];\n' +
' window["piro.sakura.ne.jp"].tabsDragUtils.fixDragData(draggedTab._dragData);\n' +
' $&'
@ -219,7 +221,8 @@
//
// let tabsWidth = 0;
// draggedTabs.forEach(function(draggedTab) {
// tabsWidth += draggedTab.boxObject[size]/*.width*/;
// let style = window.getComputedStyle(draggedTab, null);
// if (style.visibility != "collapse" && style.display != "none") tabsWidth += draggedTab.boxObject[size]/*.width*/;
// window['piro.sakura.ne.jp'].tabsDragUtils.fixDragData(draggedTab._dragData);
// if (!("animLastScreenX" in draggedTab._dragData))
// draggedTab._dragData.animLastScreenX = draggedTab._dragData[position]/*.screenX*/;

View File

@ -996,15 +996,13 @@ catch(e) {
if (tabbar._tabDropIndicator)
tabbar._tabDropIndicator.collapsed = true;
var draggedTab;
if (dt.dropEffect != 'link') {
draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
if (!draggedTab) {
var draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
if (dt.dropEffect != 'link' && !draggedTab) {
aEvent.stopPropagation();
return;
}
if (draggedTab)
draggedTab.style.opacity = '';
}
var sourceBrowser = sv.getTabBrowserFromChild(draggedTab);
if (draggedTab && sourceBrowser != b)