Fixed problem with target fields/index being erroneously applied to template

See here for discussion:

https://groups.google.com/d/msg/TiddlyWiki/D3MBNhjaT3E/ph0ZuAhuPFMJ
print-window-tiddler
Jermolene 2013-11-11 22:29:38 +00:00
rodzic e274a0c7d1
commit d64590a12b
2 zmienionych plików z 24 dodań i 16 usunięć

Wyświetl plik

@ -40,9 +40,7 @@ exports.parse = function() {
var transcludeNode = {
type: "element",
tag: "$transclude",
attributes: {
tiddler: {type: "string", value: template || targetTitle}
},
attributes: {},
isBlock: true
};
var tiddlerNode = {
@ -54,11 +52,16 @@ exports.parse = function() {
isBlock: true,
children: [transcludeNode]
};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
if(template) {
transcludeNode.attributes.tiddler = {type: "string", value: template};
} else {
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
}
return [tiddlerNode];
};

Wyświetl plik

@ -40,9 +40,8 @@ exports.parse = function() {
var transcludeNode = {
type: "element",
tag: "$transclude",
attributes: {
tiddler: {type: "string", value: template || targetTitle}
}
attributes: {},
isBlock: true
};
var tiddlerNode = {
type: "element",
@ -50,13 +49,19 @@ exports.parse = function() {
attributes: {
tiddler: {type: "string", value: targetTitle}
},
isBlock: true,
children: [transcludeNode]
};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
if(template) {
transcludeNode.attributes.tiddler = {type: "string", value: template};
} else {
transcludeNode.attributes.tiddler = {type: "string", value: targetTitle};
if(targetField) {
transcludeNode.attributes.field = {type: "string", value: targetField};
}
if(targetIndex) {
transcludeNode.attributes.index = {type: "string", value: targetIndex};
}
}
return [tiddlerNode];
};