mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-27 22:06:55 +00:00
Action-deletefield should only update tiddler modified/created if it is changed
This commit is contained in:
parent
5b3bb1974c
commit
c2391c5250
@ -57,17 +57,24 @@ Invoke the action associated with this widget
|
||||
DeleteFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
var self = this,
|
||||
tiddler = this.wiki.getTiddler(self.actionTiddler),
|
||||
removeFields = {};
|
||||
removeFields = {},
|
||||
hasChanged = false;
|
||||
if(this.actionField) {
|
||||
removeFields[this.actionField] = undefined;
|
||||
if(this.actionField in tiddler.fields) {
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
if(tiddler) {
|
||||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) !== "$" && name !== "title") {
|
||||
removeFields[name] = undefined;
|
||||
hasChanged = true;
|
||||
}
|
||||
});
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,removeFields,this.wiki.getModificationFields()));
|
||||
if(hasChanged) {
|
||||
this.wiki.addTiddler(new $tw.Tiddler(this.wiki.getCreationFields(),tiddler,removeFields,this.wiki.getModificationFields()));
|
||||
}
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user