From 9247bb0186164e727cfa2dc51395b8ba101c8903 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 9 Jun 2012 18:50:01 +0100 Subject: [PATCH] Tweaked mechanism so that macros can be nested directly inside other macros --- core/modules/macros/edit/edit.js | 1 + core/modules/macros/list.js | 1 - core/modules/macros/tiddler.js | 1 + core/modules/macros/view.js | 2 +- core/modules/treenodes/macro.js | 2 ++ 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/modules/macros/edit/edit.js b/core/modules/macros/edit/edit.js index a71e80d76..0bfe7b574 100644 --- a/core/modules/macros/edit/edit.js +++ b/core/modules/macros/edit/edit.js @@ -66,6 +66,7 @@ exports.refreshInDom = function(changes) { this.execute(this.parents,this.tiddlerTitle); // Render to the DOM this.child.renderInDom(parent,nextSibling); + this.domNode = this.child.domNode; this.addEventHandlers(); } } else { diff --git a/core/modules/macros/list.js b/core/modules/macros/list.js index 8ca9e5f80..dd489512c 100644 --- a/core/modules/macros/list.js +++ b/core/modules/macros/list.js @@ -45,7 +45,6 @@ exports.info = { } }; - exports.executeMacro = function() { var templateType = "text/x-tiddlywiki", templateText = "<>", diff --git a/core/modules/macros/tiddler.js b/core/modules/macros/tiddler.js index 74395270d..298c84040 100644 --- a/core/modules/macros/tiddler.js +++ b/core/modules/macros/tiddler.js @@ -145,6 +145,7 @@ exports.refreshInDom = function(changes) { parent.removeChild(this.child.domNode); this.execute(this.parents,this.tiddlerTitle); this.child.renderInDom(parent,nextSibling); + this.domNode = this.child.domNode; } else { this.child.refreshInDom(changes); } diff --git a/core/modules/macros/view.js b/core/modules/macros/view.js index 938b6cc9d..c80884425 100644 --- a/core/modules/macros/view.js +++ b/core/modules/macros/view.js @@ -60,7 +60,7 @@ exports.executeMacro = function() { wiki: this.wiki }); link.execute(parents,this.tiddlerTitle); - return $tw.Tree.Element("span",{},[link]); + return link; } break; case "wikified": diff --git a/core/modules/treenodes/macro.js b/core/modules/treenodes/macro.js index a55438942..3a194314f 100644 --- a/core/modules/treenodes/macro.js +++ b/core/modules/treenodes/macro.js @@ -177,6 +177,7 @@ Macro.prototype.render = function(type) { Macro.prototype.renderInDom = function(parentDomNode,insertBefore) { if(this.child) { this.child.renderInDom(parentDomNode,insertBefore); + this.domNode = this.child.domNode; this.addEventHandlers(); this.postRenderInDom(); } @@ -221,6 +222,7 @@ Macro.prototype.refreshInDom = function(changes) { parent.removeChild(this.child.domNode); this.execute(this.parents,this.tiddlerTitle); this.child.renderInDom(parent,nextSibling); + this.domNode = this.child.domNode; this.addEventHandlers(); } else { if(this.child) {