1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 11:00:27 +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-27 14:51:23 +00:00
parent 9418538104
commit 1a2ec12831

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;
}