mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-20 02:07:38 +00:00
Refactor rendertree to simplify context handling
Get rid of the separate renderContext stack and instead have a parent pointer on renderer nodes. This lets us walk back up the render tree to resolve context references
This commit is contained in:
@@ -31,7 +31,7 @@ var CheckboxWidget = function(renderer) {
|
||||
|
||||
CheckboxWidget.prototype.generate = function() {
|
||||
// Get the parameters from the attributes
|
||||
this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.getContextTiddlerTitle());
|
||||
this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.tiddlerTitle);
|
||||
this.tagName = this.renderer.getAttribute("tag");
|
||||
this["class"] = this.renderer.getAttribute("class");
|
||||
// Compute classes
|
||||
@@ -59,7 +59,7 @@ CheckboxWidget.prototype.generate = function() {
|
||||
// Set the return element
|
||||
this.tag = "label";
|
||||
this.attributes ={"class": classes.join(" ")};
|
||||
this.children = this.renderer.renderTree.createRenderers(this.renderer.renderContext,[nodeCheckbox,nodeSpan]);
|
||||
this.children = this.renderer.renderTree.createRenderers(this.renderer,[nodeCheckbox,nodeSpan]);
|
||||
this.events = [{name: "change", handlerObject: this, handlerMethod: "handleChangeEvent"}];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user