1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 10:37:20 +00:00

Fixed dependency handling for tiddler macro

This commit is contained in:
Jeremy Ruston 2012-03-30 13:49:09 +01:00
parent 65b55925de
commit 05d837aaef

View File

@ -42,7 +42,8 @@ the `template` parameter or, if that parameter is missing, the tiddler named in
/*jslint node: true */ /*jslint node: true */
"use strict"; "use strict";
var Renderer = require("../Renderer.js").Renderer; var Renderer = require("../Renderer.js").Renderer,
Dependencies = require("../Dependencies.js").Dependencies;
exports.macro = { exports.macro = {
name: "tiddler", name: "tiddler",
@ -52,6 +53,19 @@ exports.macro = {
template: {byName: true, type: "tiddler"}, template: {byName: true, type: "tiddler"},
"with": {byName: true, type: "text", dependentAll: true} "with": {byName: true, type: "text", dependentAll: true}
}, },
evaluateDependencies: function() {
var dependencies = new Dependencies(),
template = this.srcParams.template;
if(template === undefined) {
template = this.srcParams.target;
}
if(typeof template === "function") {
dependencies.dependentAll = true;
} else {
dependencies.addDependency(template,true);
}
return dependencies;
},
execute: function() { execute: function() {
var renderTitle = this.params.target, var renderTitle = this.params.target,
renderTemplate = this.params.template, renderTemplate = this.params.template,