Use action-deletefield widget in edit template fields editor

On the way to deprecating the field mangler widget
This commit is contained in:
Jermolene
2014-11-06 18:32:11 +00:00
parent da1f9f7d22
commit 92f69d44bf
3 changed files with 17 additions and 4 deletions
@@ -36,6 +36,7 @@ Compute the internal state of the widget
*/
DeleteFieldWidget.prototype.execute = function() {
this.actionTiddler = this.getAttribute("$tiddler",this.getVariable("currentTiddler"));
this.actionField = this.getAttribute("$field");
};
/*
@@ -57,6 +58,9 @@ DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
var self = this,
tiddler = this.wiki.getTiddler(self.actionTiddler),
removeFields = {};
if(this.actionField) {
removeFields[this.actionField] = undefined;
}
if(tiddler) {
$tw.utils.each(this.attributes,function(attribute,name) {
if(name.charAt(0) !== "$" && name !== "title") {