From f8f3b884a1efe3ac6da9fad0855f1892b063a196 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 11 Mar 2012 19:08:50 +0000 Subject: [PATCH] Fixed some confusing parameter names --- js/Renderer.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/Renderer.js b/js/Renderer.js index b3b23d407..04bd0d03e 100644 --- a/js/Renderer.js +++ b/js/Renderer.js @@ -198,14 +198,14 @@ MacroNode.prototype.render = function(type) { return output.join(""); }; -MacroNode.prototype.renderInDom = function(domNode,insertBefore) { +MacroNode.prototype.renderInDom = function(parentDomNode,insertBefore) { // Create the wrapper node for the macro var macroContainer = document.createElement(this.macro.wrapperTag || "span"); this.domNode = macroContainer; if(insertBefore) { - domNode.insertBefore(macroContainer,insertBefore); + parentDomNode.insertBefore(macroContainer,insertBefore); } else { - domNode.appendChild(macroContainer); + parentDomNode.appendChild(macroContainer); } // Add some debugging information to it macroContainer.setAttribute("data-tw-macro",this.macroName); @@ -334,7 +334,7 @@ ElementNode.prototype.render = function(type) { return output.join(""); }; -ElementNode.prototype.renderInDom = function(domNode) { +ElementNode.prototype.renderInDom = function(parentDomNode,insertBefore) { var element = document.createElement(this.type); if(this.attributes) { for(var a in this.attributes) { @@ -352,7 +352,11 @@ ElementNode.prototype.renderInDom = function(domNode) { } } } - domNode.appendChild(element); + if(insertBefore) { + parentDomNode.insertBefore(element,insertBefore); + } else { + parentDomNode.appendChild(element); + } this.domNode = element; if(this.children) { for(var t=0; t