From 6f3f4528c90f63036aa68db74767def67f5f082d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 2 Jun 2013 23:20:08 +0100 Subject: [PATCH] Make the edit and view widgets default to the current field --- core/modules/widgets/edit/edit.js | 2 +- core/modules/widgets/view/view.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/edit/edit.js b/core/modules/widgets/edit/edit.js index 5aa96f545..34b838083 100644 --- a/core/modules/widgets/edit/edit.js +++ b/core/modules/widgets/edit/edit.js @@ -27,7 +27,7 @@ var EditWidget = function(renderer) { EditWidget.prototype.generate = function() { // Get parameters from our attributes 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 // 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), diff --git a/core/modules/widgets/view/view.js b/core/modules/widgets/view/view.js index 89da9f686..e87f1d771 100644 --- a/core/modules/widgets/view/view.js +++ b/core/modules/widgets/view/view.js @@ -55,7 +55,7 @@ var ViewWidget = function(renderer) { ViewWidget.prototype.generate = function() { // Get parameters from our attributes 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"); // Get the value to display var tiddler = this.renderer.renderTree.wiki.getTiddler(this.tiddlerTitle),