summaryrefslogtreecommitdiff
path: root/js/common.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-21 10:34:28 +0300
committerAndrew Dolgov <[email protected]>2021-02-21 10:34:28 +0300
commit9e56896bd428114ff9bfd979c2d4ff8d93f99485 (patch)
tree9d742ae89104eced0328f749fc7cf2898b559a77 /js/common.js
parentd6de021ae6eb3e2385630763f2f5daab2566a499 (diff)
Element visible: check for offsetHeight/offsetWidth
Diffstat (limited to 'js/common.js')
-rwxr-xr-xjs/common.js3
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) {