Fix webcomponent attributes (class) were causing errors in nextmatch instead of being checked for variables

This commit is contained in:
nathan 2021-09-03 14:45:45 -06:00
parent 968a2d03bb
commit 347ea25131

View File

@ -287,20 +287,28 @@ export class et2_nextmatch_rowProvider
continue; continue;
} }
let attr_name = key;
let val;
if(!_widget.attributes[key].ignore && if(!_widget.attributes[key].ignore &&
typeof _widget.options != "undefined" &&
typeof _widget.options[key] != "undefined") typeof _widget.options[key] != "undefined")
{ {
const val = _widget.options[key]; val = _widget.options[key];
}
// TODO: Improve detection // Handle web components
if(typeof val == "string" && val.indexOf("$") >= 0) else if(_widget.attributes[key].value)
{ {
hasAttr = true; val = _widget.attributes[key].value;
widgetData.data.push({ attr_name = _widget.attributes[key].name;
"attribute": key, }
"expression": val // TODO: Improve detection
}); if(typeof val == "string" && val.indexOf("$") >= 0)
} {
hasAttr = true;
widgetData.data.push({
"attribute": attr_name,
"expression": val
});
} }
} }