From 9e56896bd428114ff9bfd979c2d4ff8d93f99485 Mon Sep 17 00:00:00 2001
From: Andrew Dolgov <noreply@fakecake.org>
Date: Sun, 21 Feb 2021 10:34:28 +0300
Subject: [PATCH] Element visible: check for offsetHeight/offsetWidth

---
 js/common.js | 3 +--
 1 file changed, 1 insertion(+), 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) {
-- 
GitLab