1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Make the edit and view widgets default to the current field

This commit is contained in:
Jeremy Ruston 2013-06-02 23:20:08 +01:00
parent d5b0a0fb68
commit 6f3f4528c9
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ var EditWidget = function(renderer) {
EditWidget.prototype.generate = function() { EditWidget.prototype.generate = function() {
// Get parameters from our attributes // Get parameters from our attributes
this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.tiddlerTitle); this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.tiddlerTitle);
this.fieldName = this.renderer.getAttribute("field","text"); this.fieldName = this.renderer.getAttribute("field",this.renderer.renderTree.getContextVariable(this.renderer,"field","text"));
// Choose the editor to use // Choose the editor to use
// TODO: Tiddler field modules should be able to specify a field type from which the editor is derived // TODO: Tiddler field modules should be able to specify a field type from which the editor is derived
var tiddler = this.renderer.renderTree.wiki.getTiddler(this.tiddlerTitle), var tiddler = this.renderer.renderTree.wiki.getTiddler(this.tiddlerTitle),

View File

@ -55,7 +55,7 @@ var ViewWidget = function(renderer) {
ViewWidget.prototype.generate = function() { ViewWidget.prototype.generate = function() {
// Get parameters from our attributes // Get parameters from our attributes
this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.tiddlerTitle); this.tiddlerTitle = this.renderer.getAttribute("tiddler",this.renderer.tiddlerTitle);
this.fieldName = this.renderer.getAttribute("field","text"); this.fieldName = this.renderer.getAttribute("field",this.renderer.renderTree.getContextVariable(this.renderer,"field","text"));
this.format = this.renderer.getAttribute("format","text"); this.format = this.renderer.getAttribute("format","text");
// Get the value to display // Get the value to display
var tiddler = this.renderer.renderTree.wiki.getTiddler(this.tiddlerTitle), var tiddler = this.renderer.renderTree.wiki.getTiddler(this.tiddlerTitle),