mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-27 09:24:45 +00:00
Fix checkbox setting text field to empty string
This commit is contained in:
parent
f4b834aa2a
commit
aea06f7df4
@ -87,7 +87,8 @@ CheckboxWidget.prototype.getValue = function() {
|
|||||||
CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
||||||
var checked = this.inputDomNode.checked,
|
var checked = this.inputDomNode.checked,
|
||||||
tiddler = this.wiki.getTiddler(this.checkboxTitle),
|
tiddler = this.wiki.getTiddler(this.checkboxTitle),
|
||||||
newFields = {title: this.checkboxTitle, text: ""},
|
fallbackFields = {text: ""},
|
||||||
|
newFields = {title: this.checkboxTitle},
|
||||||
hasChanged = false;
|
hasChanged = false;
|
||||||
// Set the tag if specified
|
// Set the tag if specified
|
||||||
if(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) {
|
if(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) {
|
||||||
@ -110,7 +111,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(hasChanged) {
|
if(hasChanged) {
|
||||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,newFields,this.wiki.getModificationFields()));
|
this.wiki.addTiddler(new $tw.Tiddler(fallbackFields,tiddler,newFields,this.wiki.getModificationFields()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user