mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-10-02 00:40:47 +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
|
// Create the transclude widget
|
||||||
return {
|
var widget = {
|
||||||
type: "element",
|
type: "element",
|
||||||
tag: "$transclude",
|
tag: "$transclude",
|
||||||
isBlock: this.renderer.parseTreeNode.isBlock,
|
isBlock: this.renderer.parseTreeNode.isBlock,
|
||||||
attributes: {
|
attributes: {},
|
||||||
target: {type: "string", value: title},
|
|
||||||
template: {type: "string", value: template}
|
|
||||||
},
|
|
||||||
children: templateTree
|
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…
Reference in New Issue
Block a user