mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 18:00:26 +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:
parent
b759d82f4c
commit
cf28eeb2a1
@ -65,7 +65,12 @@ CheckboxWidget.prototype.getValue = function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.checkboxField) {
|
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) {
|
if(value === this.checkboxChecked) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user