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;
}
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
});
}
}