mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-30 23:36:56 +00:00
Extend wiki.makeTranscludeWidget() to control mode
This commit is contained in:
parent
cf11741df9
commit
a4a9daa40b
@ -905,6 +905,7 @@ Make a widget tree for transclusion
|
||||
title: target tiddler title
|
||||
options: as for wiki.makeWidget() plus:
|
||||
options.field: optional field to transclude (defaults to "text")
|
||||
options.mode: transclusion mode "inline" or "block"
|
||||
options.children: optional array of children for the transclude widget
|
||||
*/
|
||||
exports.makeTranscludeWidget = function(title,options) {
|
||||
@ -924,6 +925,9 @@ exports.makeTranscludeWidget = function(title,options) {
|
||||
if(options.field) {
|
||||
parseTree.tree[0].children[0].attributes.field = {type: "string", value: options.field};
|
||||
}
|
||||
if(options.mode) {
|
||||
parseTree.tree[0].children[0].attributes.mode = {type: "string", value: options.mode};
|
||||
}
|
||||
if(options.children) {
|
||||
parseTree.tree[0].children[0].children = options.children;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user