1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Fixed issue with textnodes ignoring insertBefore parameter

This commit is contained in:
Jeremy Ruston 2012-06-13 10:41:36 +01:00
parent 0830cdac73
commit 558aaf338f

View File

@ -29,9 +29,13 @@ Text.prototype.render = function(type) {
return type === "text/html" ? $tw.utils.htmlEncode(this.text) : this.text;
};
Text.prototype.renderInDom = function(domNode) {
Text.prototype.renderInDom = function(parentDomNode,insertBefore) {
this.domNode = document.createTextNode(this.text);
domNode.appendChild(this.domNode);
if(insertBefore) {
parentDomNode.insertBefore(this.domNode,insertBefore);
} else {
parentDomNode.appendChild(this.domNode);
}
};
exports.Text = Text;