mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-03 12:23:51 +00:00
Fixed issue with textnodes ignoring insertBefore parameter
This commit is contained in:
parent
0830cdac73
commit
558aaf338f
@ -29,9 +29,13 @@ Text.prototype.render = function(type) {
|
|||||||
return type === "text/html" ? $tw.utils.htmlEncode(this.text) : this.text;
|
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);
|
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;
|
exports.Text = Text;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user