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 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;