mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +00:00
Fix document references
This commit is contained in:
parent
9739e825b4
commit
6e1cd46bc7
@ -31,7 +31,7 @@ var WikiRenderTree = function(parser,options) {
|
||||
this.wiki = options.wiki;
|
||||
this.context = options.context || {};
|
||||
this.parentRenderer = options.parentRenderer;
|
||||
this.document = options.document || (typeof(document) === "object" ? document : null);
|
||||
this.document = options.document;
|
||||
// Hashmap of the renderer classes
|
||||
if(!this.rendererClasses) {
|
||||
WikiRenderTree.prototype.rendererClasses = $tw.modules.applyMethods("wikirenderer");
|
||||
|
@ -112,7 +112,7 @@ exports.startup = function() {
|
||||
// Display the PageTemplate
|
||||
var templateTitle = "$:/templates/PageTemplate",
|
||||
parser = $tw.wiki.parseTiddler(templateTitle),
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: $tw.wiki, context: {tiddlerTitle: templateTitle}});
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: $tw.wiki, context: {tiddlerTitle: templateTitle}, document: document});
|
||||
renderTree.execute();
|
||||
var container = document.createElement("div");
|
||||
document.body.insertBefore(container,document.body.firstChild);
|
||||
|
@ -35,7 +35,7 @@ StylesheetManager.prototype.addStylesheet = function(title) {
|
||||
this.stylesheets[title] = true;
|
||||
// Parse the tiddler and render as plain text
|
||||
var parser = this.wiki.parseTiddler(title),
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: this.wiki, context: {tiddlerTitle: title}});
|
||||
renderTree = new $tw.WikiRenderTree(parser,{wiki: this.wiki, context: {tiddlerTitle: title}, document: $tw.document});
|
||||
renderTree.execute();
|
||||
var container = $tw.document.createElement("div");
|
||||
renderTree.renderInDom(container);
|
||||
|
Loading…
Reference in New Issue
Block a user