Fixed issue where $parameters did nothing with no $transclude (#8203)

* Fixed issue where $parameters did nothing with no $transclude

* Figured I should test \parameters too
This commit is contained in:
Cameron Fischer
2024-06-06 06:20:35 -04:00
committed by GitHub
parent 33bc77f46f
commit 352272905e
2 changed files with 32 additions and 0 deletions

View File

@@ -74,6 +74,18 @@ ParametersWidget.prototype.execute = function() {
self.setVariable(variableName,getValue(name));
}
});
} else {
// There is no parent transclude. i.e. direct rendering.
// We use default values only.
$tw.utils.each($tw.utils.getOrderedAttributesFromParseTreeNode(self.parseTreeNode),function(attr,index) {
var name = attr.name;
// If the attribute name starts with $$ then reduce to a single dollar
if(name.substr(0,2) === "$$") {
name = name.substr(1);
}
var value = self.getAttribute(attr.name,"");
self.setVariable(name,value);
});
}
// Construct the child widgets
this.makeChildWidgets();