updated #1480 "undefined value removes field or index"

when $value is unspecified, $action-setfield removes field or index...

modified

setText() — $:/core/modules/wiki.js
invokeAction() — $:/core/modules/widgets/action-setfield

demo

http://tobibeer.github.io/tw/batch/#ActionSetField-RemoveIndex
This commit is contained in:
Tobias Beer
2015-09-25 15:20:37 +02:00
parent 57c40a8a56
commit 6b3fc8d538
3 changed files with 7 additions and 5 deletions
+1 -3
View File
@@ -61,9 +61,7 @@ SetFieldWidget.prototype.invokeAction = function(triggeringWidget,event) {
var self = this,
options = {};
options.suppressTimestamp = !this.actionTimestamp;
if(typeof this.actionValue === "string") {
this.wiki.setText(this.actionTiddler,this.actionField,this.actionIndex,this.actionValue,options);
}
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,options);