1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-11 21:14:02 +00:00

Refactored widgets not to use a base class

This commit is contained in:
Jeremy Ruston
2013-01-01 17:51:02 +00:00
parent f8340bc4dc
commit d96e0073ac
10 changed files with 100 additions and 79 deletions

View File

@@ -12,16 +12,14 @@ The view widget displays the fields of a tiddler through a text substitution tem
/*global $tw: false */
"use strict";
exports.name = "fields";
exports.init = function(renderer) {
var FieldsWidget = function(renderer) {
// Save state
this.renderer = renderer;
// Generate child nodes
this.generateChildNodes();
};
exports.generateChildNodes = function() {
FieldsWidget.prototype.generateChildNodes = function() {
// Get parameters from our attributes
this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.getContextTiddlerTitle());
this.template = this.renderer.getAttribute("template");
@@ -75,4 +73,6 @@ exports.generateChildNodes = function() {
this.children = this.renderer.renderTree.createRenderers(this.renderer.renderContext,[node]);
};
exports.fields = FieldsWidget;
})();