mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-20 01:05:15 +00:00
Update actionsetfield widget to allow timestamp to be preserved
This commit is contained in:
@@ -39,6 +39,7 @@ SetFieldWidget.prototype.execute = function() {
|
||||
this.actionField = this.getAttribute("$field");
|
||||
this.actionIndex = this.getAttribute("$index");
|
||||
this.actionValue = this.getAttribute("$value");
|
||||
this.actionTimestamp = this.getAttribute("$timestamp","yes") === "yes";
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -57,13 +58,15 @@ SetFieldWidget.prototype.refresh = function(changedTiddlers) {
|
||||
Invoke the action associated with this widget
|
||||
*/
|
||||
SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
|
||||
var self = this;
|
||||
var self = this,
|
||||
options = {};
|
||||
options.timestamp = this.actionTimestamp;
|
||||
if(typeof this.actionValue === "string") {
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue);
|
||||
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
|
||||
}
|
||||
$tw.utils.each(this.attributes,function(attribute,name) {
|
||||
if(name.charAt(0) !== "$") {
|
||||
self.wiki.setText(self.actionTiddler,name,undefined,attribute);
|
||||
self.wiki.setText(self.actionTiddler,name,undefined,attribute,options);
|
||||
}
|
||||
});
|
||||
return true; // Action was invoked
|
||||
|
||||
Reference in New Issue
Block a user