diff options
author | Andrew Dolgov <[email protected]> | 2021-02-21 10:34:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-21 10:34:28 +0300 |
commit | 9e56896bd428114ff9bfd979c2d4ff8d93f99485 (patch) | |
tree | 9d742ae89104eced0328f749fc7cf2898b559a77 | |
parent | d6de021ae6eb3e2385630763f2f5daab2566a499 (diff) |
Element visible: check for offsetHeight/offsetWidth
-rwxr-xr-x | js/common.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/js/common.js b/js/common.js index 6e8168357..e85862990 100755 --- a/js/common.js +++ b/js/common.js @@ -86,8 +86,7 @@ Element.prototype.fadeIn = function(display = undefined){ }; Element.prototype.visible = function() { - // TODO: should we actually check for offsetWidth/offsetHeight == 0? - return this.style.display != "none"; + return this.style.display != "none" && this.offsetHeight != 0 && this.offsetWidth != 0; } Element.visible = function(elem) { |