From 800e64c94db97f104ee56ca6366b28495ec0948e Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sun, 23 Jan 2011 04:03:39 +0900 Subject: [PATCH] When the twisty style is "none", entire tabs are recognized as "twisty" unexpectedly. (fix for https://github.com/piroor/treestyletab/issues#issue/21 ) --- modules/utils.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/utils.js b/modules/utils.js index a101ae5a..e9caf79e 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -683,20 +683,23 @@ var TreeStyleTabUtils = { var minY = box.screenY; var maxX = minX + box.width; var maxY = minY + box.height; + var icon = tab.ownerDocument.getAnonymousElementByAttribute(tab, 'class', 'tab-icon'); + var iconBox = icon.boxObject; if (!box.width || !box.height) { - minX = maxX = tab.boxObject.screenX + tab.boxObject.width; - minY = maxY = tab.boxObject.screenY + tab.boxObject.height; + minX = iconBox.screenX; + minY = iconBox.screenY; + maxX = minX + iconBox.width; + maxY = minY + iconBox.height; } if ( - (this.shouldExpandTwistyArea || !box.width || !box.height) && + box.width && box.height && + this.shouldExpandTwistyArea && !this._expandTwistyAreaBlockers.length ) { - let icon = tab.ownerDocument.getAnonymousElementByAttribute(tab, 'class', 'tab-icon'); - let box = icon.boxObject; - minX = Math.min(minX, box.screenX); - minY = Math.min(minY, box.screenY); - maxX = Math.max(maxX, box.screenX + box.width); - maxY = Math.max(maxY, box.screenY + box.height); + minX = Math.min(minX, iconBox.screenX); + minY = Math.min(minY, iconBox.screenY); + maxX = Math.max(maxX, iconBox.screenX + iconBox.width); + maxY = Math.max(maxY, iconBox.screenY + iconBox.height); } var x = aEvent.screenX;