1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-22 11:17:39 +00:00

Revert "Extend transclude widget to optionally set variables"

Actually a partial reversion, because we're keeping the minor refactoring of makeChildWidget() in widget.js

This reverts commit 80ee5adb14.
This commit is contained in:
jeremy@jermolene.com
2021-04-02 09:47:38 +01:00
parent 54d3782167
commit 28521d82f3
2 changed files with 3 additions and 13 deletions

View File

@@ -75,17 +75,8 @@ 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,{
variables: variables
});
this.makeChildWidgets(parseTreeNodes);
};
/*
@@ -112,7 +103,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of
*/
TranscludeWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if($tw.utils.count(changedAttributes) || changedTiddlers[this.transcludeTitle]) {
if(changedAttributes.tiddler || changedAttributes.field || changedAttributes.index || changedTiddlers[this.transcludeTitle]) {
this.refreshSelf();
return true;
} else {