From eec7209a5c1d57546496f1fd589c7ad76731ba64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 14 Jun 2011 00:20:27 +0100 Subject: [PATCH] Define DomElement.isInvisible(), to check if the given element is not displaying. --- src/browser/DomElement.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/browser/DomElement.js b/src/browser/DomElement.js index 132246d8..b1d2cec8 100644 --- a/src/browser/DomElement.js +++ b/src/browser/DomElement.js @@ -57,7 +57,16 @@ var DomElement = new function() { ); }, - // Checks if element is visibile in current viewport + /** + * Checks if element is invisibile (display: none, ...) + */ + isInvisible: function(el) { + return DomElement.getSize(el).equals([0, 0]); + }, + + /** + * Checks if element is visibile in current viewport + */ isVisible: function(el) { // See if the scrolled bounds intersect with the windows rectangle // which always starts at 0, 0