From 347ea2513187c0c93cf6aaf349144033c8573818 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 3 Sep 2021 14:45:45 -0600 Subject: [PATCH] Fix webcomponent attributes (class) were causing errors in nextmatch instead of being checked for variables --- .../et2_extension_nextmatch_rowProvider.ts | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts b/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts index ba1b57f4dc..f5ea0b4a25 100644 --- a/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts +++ b/api/js/etemplate/et2_extension_nextmatch_rowProvider.ts @@ -287,20 +287,28 @@ export class et2_nextmatch_rowProvider continue; } + let attr_name = key; + let val; if(!_widget.attributes[key].ignore && + typeof _widget.options != "undefined" && typeof _widget.options[key] != "undefined") { - const val = _widget.options[key]; - - // TODO: Improve detection - if(typeof val == "string" && val.indexOf("$") >= 0) - { - hasAttr = true; - widgetData.data.push({ - "attribute": key, - "expression": val - }); - } + val = _widget.options[key]; + } + // Handle web components + else if(_widget.attributes[key].value) + { + val = _widget.attributes[key].value; + attr_name = _widget.attributes[key].name; + } + // TODO: Improve detection + if(typeof val == "string" && val.indexOf("$") >= 0) + { + hasAttr = true; + widgetData.data.push({ + "attribute": attr_name, + "expression": val + }); } }