mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-22 19:27:40 +00:00
Extend transclude widget to optionally set variables
Partially fixes #5199
This commit is contained in:
@@ -75,8 +75,17 @@ TranscludeWidget.prototype.execute = function() {
|
||||
]}];
|
||||
}
|
||||
}
|
||||
// Assign any variables set via attributes starting with $
|
||||
var variables = Object.create(null);
|
||||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) === "$") {
|
||||
variables[name.substr(1)] = attribute;
|
||||
}
|
||||
});
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets(parseTreeNodes);
|
||||
this.makeChildWidgets(parseTreeNodes,{
|
||||
variables: variables
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user