From a73f0771e669341582d10687bbb4667a454aebb3 Mon Sep 17 00:00:00 2001 From: nathan Date: Mon, 6 Dec 2021 14:41:13 -0700 Subject: [PATCH] Fix TypeError: Cannot read properties of undefined (reading 'position') Caused by LitElement not having a styles property. Just skip those to avoid the error --- api/js/jsapi/egw_utils.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/api/js/jsapi/egw_utils.js b/api/js/jsapi/egw_utils.js index b00a0cf51d..e08680f7d5 100644 --- a/api/js/jsapi/egw_utils.js +++ b/api/js/jsapi/egw_utils.js @@ -268,8 +268,12 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() var oldProps = []; $hiddenParents.each(function() { var old = {}; - for ( var name in props ) { - old[ name ] = this.style[ name ]; + if (this.styles) + { + for (var name in props) + { + old[name] = this.style[name]; + } } jQuery(this).show(); oldProps.push(old); @@ -282,8 +286,12 @@ egw.extend('utils', egw.MODULE_GLOBAL, function() $hiddenParents.each(function(i) { var old = oldProps[i]; - for ( var name in props ) { - this.style[ name ] = old[ name ]; + if (this.style) + { + for (var name in props) + { + this.style[name] = old[name]; + } } }); //$.log(”w: ” + dim.w + ”, h:” + dim.h)