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,7 +131,9 @@
'if (!("animLastScreenX" in draggedTab._dragData))', 'if (!("animLastScreenX" in draggedTab._dragData))',
'let tabsWidth = 0;\n' + 'let tabsWidth = 0;\n' +
'draggedTabs.forEach(function(draggedTab) {\n' + 'draggedTabs.forEach(function(draggedTab) {\n' +
' tabsWidth += draggedTab.boxObject[size];\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' + ' window["piro.sakura.ne.jp"].tabsDragUtils.fixDragData(draggedTab._dragData);\n' +
' $&' ' $&'
).replace( ).replace(
@ -219,7 +221,8 @@
// //
// let tabsWidth = 0; // let tabsWidth = 0;
// draggedTabs.forEach(function(draggedTab) { // 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); // window['piro.sakura.ne.jp'].tabsDragUtils.fixDragData(draggedTab._dragData);
// if (!("animLastScreenX" in draggedTab._dragData)) // if (!("animLastScreenX" in draggedTab._dragData))
// draggedTab._dragData.animLastScreenX = draggedTab._dragData[position]/*.screenX*/; // draggedTab._dragData.animLastScreenX = draggedTab._dragData[position]/*.screenX*/;

View File

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