mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-23 09:48:43 +00:00
Fix removing a field with empty name (#6888)
* allow us to remove a field with empty key * fix typo in if clause
This commit is contained in:
@@ -36,7 +36,7 @@ Compute the internal state of the widget
|
|||||||
*/
|
*/
|
||||||
DeleteFieldWidget.prototype.execute = function() {
|
DeleteFieldWidget.prototype.execute = function() {
|
||||||
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
|
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
|
||||||
this.actionField = this.getAttribute("$field");
|
this.actionField = this.getAttribute("$field",null);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -59,7 +59,7 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
|||||||
tiddler = this.wiki.getTiddler(self.actionTiddler),
|
tiddler = this.wiki.getTiddler(self.actionTiddler),
|
||||||
removeFields = {},
|
removeFields = {},
|
||||||
hasChanged = false;
|
hasChanged = false;
|
||||||
if(this.actionField && tiddler) {
|
if((this.actionField !== null) && tiddler) {
|
||||||
removeFields[this.actionField] = undefined;
|
removeFields[this.actionField] = undefined;
|
||||||
if(this.actionField in tiddler.fields) {
|
if(this.actionField in tiddler.fields) {
|
||||||
hasChanged = true;
|
hasChanged = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user