1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-21 18:57:40 +00:00

SetWidget: Add "subtiddler" attribute

This commit is contained in:
Jermolene
2018-03-16 20:35:41 +00:00
parent b43ff430b7
commit 0d354fe57f
2 changed files with 9 additions and 2 deletions

View File

@@ -42,6 +42,7 @@ SetWidget.prototype.execute = function() {
this.setFilter = this.getAttribute("filter");
this.setSelect = this.getAttribute("select");
this.setTiddler = this.getAttribute("tiddler");
this.setSubTiddler = this.getAttribute("subtiddler");
this.setField = this.getAttribute("field");
this.setIndex = this.getAttribute("index");
this.setValue = this.getAttribute("value");
@@ -58,7 +59,12 @@ Get the value to be assigned
SetWidget.prototype.getValue = function() {
var value = this.setValue;
if(this.setTiddler) {
var tiddler = this.wiki.getTiddler(this.setTiddler);
var tiddler;
if(this.setSubTiddler) {
tiddler = this.wiki.getSubTiddler(this.setTiddler,this.setSubTiddler);
} else {
tiddler = this.wiki.getTiddler(this.setTiddler);
}
if(!tiddler) {
value = this.setEmptyValue;
} else if(this.setField) {