mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-02 08:46:56 +00:00
Hack the list widget
Usually the list transcludes each tiddler through the sample template. This hack makes it work differently, where each tiddler is used as a template to render the same current tiddler. The attribute that switches modes is called "hackTemplate" because this is a temporary implementation of this capability for experimental purposes
This commit is contained in:
parent
67c1d2cf55
commit
8cbb98d44d
@ -198,16 +198,22 @@ ListWidget.prototype.createListElementTransclusion = function(title) {
|
||||
}
|
||||
}
|
||||
// Create the transclude widget
|
||||
return {
|
||||
var widget = {
|
||||
type: "element",
|
||||
tag: "$transclude",
|
||||
isBlock: this.renderer.parseTreeNode.isBlock,
|
||||
attributes: {
|
||||
target: {type: "string", value: title},
|
||||
template: {type: "string", value: template}
|
||||
},
|
||||
attributes: {},
|
||||
children: templateTree
|
||||
};
|
||||
// Set the target if needed
|
||||
if(!this.renderer.hasAttribute("hackTemplate")) {
|
||||
widget.attributes.target = {type: "string", value: title};
|
||||
widget.attributes.template = {type: "string", value: template};
|
||||
} else {
|
||||
widget.attributes.template = {type: "string", value: title};
|
||||
widget.children = undefined;
|
||||
}
|
||||
return widget;
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user