From aea06f7df479f8a38d9b089bd3f4ebdd090c1022 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 30 Jul 2014 11:52:45 +0100 Subject: [PATCH] Fix checkbox setting text field to empty string --- core/modules/widgets/checkbox.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/modules/widgets/checkbox.js b/core/modules/widgets/checkbox.js index 64d4b2389..d13496c95 100644 --- a/core/modules/widgets/checkbox.js +++ b/core/modules/widgets/checkbox.js @@ -87,7 +87,8 @@ CheckboxWidget.prototype.getValue = function() { CheckboxWidget.prototype.handleChangeEvent = function(event) { var checked = this.inputDomNode.checked, tiddler = this.wiki.getTiddler(this.checkboxTitle), - newFields = {title: this.checkboxTitle, text: ""}, + fallbackFields = {text: ""}, + newFields = {title: this.checkboxTitle}, hasChanged = false; // Set the tag if specified if(this.checkboxTag && (!tiddler || tiddler.hasTag(this.checkboxTag) !== checked)) { @@ -110,7 +111,7 @@ CheckboxWidget.prototype.handleChangeEvent = function(event) { } } 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())); } };