1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Fix problem with checkbox widget and empty strings

If the value of `tiddler.fields[this.checkboxField]` was an empty
string then it would incorrectly fall back to the value of
`this.checkboxDefault`.
This commit is contained in:
Jermolene 2016-11-28 13:45:41 +00:00
parent b759d82f4c
commit cf28eeb2a1

View File

@ -65,7 +65,12 @@ CheckboxWidget.prototype.getValue = function() {
}
}
if(this.checkboxField) {
var value = tiddler.fields[this.checkboxField] || this.checkboxDefault || "";
var value;
if($tw.utils.hop(tiddler.fields,this.checkboxField)) {
value = tiddler.fields[this.checkboxField] || "";
} else {
value = this.checkboxDefault || "";
}
if(value === this.checkboxChecked) {
return true;
}