mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
parent
927013a57a
commit
4e01fc1838
@ -24,13 +24,13 @@ exports.isDraft = function() {
|
||||
return this.hasField("draft.of");
|
||||
};
|
||||
|
||||
exports.getFieldString = function(field) {
|
||||
exports.getFieldString = function(field,defaultValue) {
|
||||
var value = this.fields[field];
|
||||
// Check for a missing field
|
||||
if(value === undefined || value === null) {
|
||||
return "";
|
||||
return defaultValue || "";
|
||||
}
|
||||
// Parse the field with the associated module (if any)
|
||||
// Stringify the field with the associated tiddler field module (if any)
|
||||
var fieldModule = $tw.Tiddler.fieldModules[field];
|
||||
if(fieldModule && fieldModule.stringify) {
|
||||
return fieldModule.stringify.call(this,value);
|
||||
|
@ -64,9 +64,9 @@ RadioWidget.prototype.getValue = function() {
|
||||
tiddler = this.wiki.getTiddler(this.radioTitle);
|
||||
if(tiddler) {
|
||||
if(this.radioIndex) {
|
||||
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex);
|
||||
value = this.wiki.extractTiddlerDataItem(this.radioTitle,this.radioIndex,this.radioDefault);
|
||||
} else {
|
||||
value = tiddler.getFieldString(this.radioField);
|
||||
value = tiddler.getFieldString(this.radioField,this.radioDefault);
|
||||
}
|
||||
} else {
|
||||
value = this.radioDefault;
|
||||
|
Loading…
Reference in New Issue
Block a user