When the twisty style is "none", entire tabs are recognized as "twisty" unexpectedly. (fix for https://github.com/piroor/treestyletab/issues#issue/21 )

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-01-23 04:03:39 +09:00
parent 734eac6509
commit 800e64c94d

View File

@ -683,20 +683,23 @@ var TreeStyleTabUtils = {
var minY = box.screenY; var minY = box.screenY;
var maxX = minX + box.width; var maxX = minX + box.width;
var maxY = minY + box.height; var maxY = minY + box.height;
var icon = tab.ownerDocument.getAnonymousElementByAttribute(tab, 'class', 'tab-icon');
var iconBox = icon.boxObject;
if (!box.width || !box.height) { if (!box.width || !box.height) {
minX = maxX = tab.boxObject.screenX + tab.boxObject.width; minX = iconBox.screenX;
minY = maxY = tab.boxObject.screenY + tab.boxObject.height; minY = iconBox.screenY;
maxX = minX + iconBox.width;
maxY = minY + iconBox.height;
} }
if ( if (
(this.shouldExpandTwistyArea || !box.width || !box.height) && box.width && box.height &&
this.shouldExpandTwistyArea &&
!this._expandTwistyAreaBlockers.length !this._expandTwistyAreaBlockers.length
) { ) {
let icon = tab.ownerDocument.getAnonymousElementByAttribute(tab, 'class', 'tab-icon'); minX = Math.min(minX, iconBox.screenX);
let box = icon.boxObject; minY = Math.min(minY, iconBox.screenY);
minX = Math.min(minX, box.screenX); maxX = Math.max(maxX, iconBox.screenX + iconBox.width);
minY = Math.min(minY, box.screenY); maxY = Math.max(maxY, iconBox.screenY + iconBox.height);
maxX = Math.max(maxX, box.screenX + box.width);
maxY = Math.max(maxY, box.screenY + box.height);
} }
var x = aEvent.screenX; var x = aEvent.screenX;