From 65bfb091e19fe922463496c0466a91c3c3fccad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 20 Jun 2011 22:51:05 +0100 Subject: [PATCH] Filter out invisible elements in DomElement.isVisible() check. --- src/browser/DomElement.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/browser/DomElement.js b/src/browser/DomElement.js index b1d2cec8..975c5598 100644 --- a/src/browser/DomElement.js +++ b/src/browser/DomElement.js @@ -70,8 +70,9 @@ var DomElement = new function() { isVisible: function(el) { // See if the scrolled bounds intersect with the windows rectangle // which always starts at 0, 0 - return new Rectangle([0, 0], DomElement.getWindowSize()) - .intersects(DomElement.getBounds(el, false, true)); + return !DomElement.isInvisible(el) + && new Rectangle([0, 0], DomElement.getWindowSize()) + .intersects(DomElement.getBounds(el, false, true)); } }; };