mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-24 12:17:39 +00:00
Fixed bug when using checkbox widget to apply a tag to a tiddler that is untagged
This commit is contained in:
@@ -62,7 +62,7 @@ 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);
|
||||||
if(tiddler && tiddler.hasTag(this.checkboxTag) !== checked) {
|
if(tiddler && tiddler.hasTag(this.checkboxTag) !== checked) {
|
||||||
var newTags = tiddler.fields.tags.slice(0),
|
var newTags = (tiddler.fields.tags || []).slice(0),
|
||||||
pos = newTags.indexOf(this.checkboxTag);
|
pos = newTags.indexOf(this.checkboxTag);
|
||||||
if(pos !== -1) {
|
if(pos !== -1) {
|
||||||
newTags.splice(pos,1);
|
newTags.splice(pos,1);
|
||||||
|
|||||||
Reference in New Issue
Block a user