From 3042dec27eeb4651adcc2b2dd7e4b8aedc239d35 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Thu, 11 Oct 2012 21:55:24 +0900 Subject: [PATCH] Update Multiple Tabs Drag and Drop Utilities --- content/treestyletab/res/tabsDragUtils.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/content/treestyletab/res/tabsDragUtils.js b/content/treestyletab/res/tabsDragUtils.js index da2308f2..cc257a0b 100644 --- a/content/treestyletab/res/tabsDragUtils.js +++ b/content/treestyletab/res/tabsDragUtils.js @@ -133,7 +133,8 @@ 'if (!("animLastScreenX" in draggedTab._dragData))', 'let tabsWidth = 0;\n' + 'draggedTabs.forEach(function(draggedTab) {\n' + - ' tabsWidth += draggedTab.boxObject.width;\n' + + ' tabsWidth += draggedTab.boxObject[size];\n' + + ' window["piro.sakura.ne.jp"].tabsDragUtils.fixDragData(draggedTab._dragData);\n' + ' $&' ).replace( 'draggedTab._dragData.animLastScreenX = draggedTab._dragData[position];', @@ -220,6 +221,7 @@ // let tabsWidth = 0; // draggedTabs.forEach(function(draggedTab) { // 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*/; // }, this); @@ -250,7 +252,7 @@ // let rightTab = tabs[tabs.length - 1]; // // let tabScreenX = draggedTab.boxObject[position]/*.screenX*/; -// let translateX = screenX - draggedTab._dragData[position]/*.screenX*/; +// let translateX = screenX - draggedTab._dragData[offset]/*.offsetX*/; // if (!pinned) // translateX += this.mTabstrip.scrollPosition - draggedTab._dragData[scroll]/*.scrollX*/; // let leftBound = leftTab.boxObject[position]/*.screenX*/ - tabScreenX; @@ -326,6 +328,13 @@ // } } }, + fixDragData : function TDU_fixDragData(aData) + { + if (!('screenY' in aData)) + aData.screenY = aData.offsetY + window.screenY; + if (!('scrollY' in aData)) + aData.scrollY = aData.scrollX; + }, startTabsDrag : function TDU_startTabsDrag(aEvent, aTabs) { @@ -377,7 +386,7 @@ isVertical : function TDS_isVertical(aElement) { let style = window.getComputedStyle(aElement, null); - return (style.MozOrient || style.orient) == 'vertical'; + return (aElement.orient || style.MozOrient || style.orient) == 'vertical'; }, getClientX : function TDS_getClientX(aElement) {