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:
@@ -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;
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user