mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-18 07:44:51 +00:00
Fix fieldmanger to update modified and modifier fields
This commit is contained in:
parent
810167bc7b
commit
4ece301a97
@ -75,7 +75,7 @@ FieldManglerWidget.prototype.handleAddFieldEvent = function(event) {
|
||||
if(tiddler && typeof event.param === "string") {
|
||||
var name = event.param.toLowerCase();
|
||||
if(name !== "" && !$tw.utils.hop(tiddler.fields,name)) {
|
||||
var addition = {};
|
||||
var addition = this.wiki.getModificationFields();
|
||||
addition[name] = "";
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,addition));
|
||||
}
|
||||
@ -88,7 +88,7 @@ FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {
|
||||
if(tiddler && tiddler.fields.tags) {
|
||||
var p = tiddler.fields.tags.indexOf(event.param);
|
||||
if(p !== -1) {
|
||||
var modification = {};
|
||||
var modification = this.wiki.getModificationFields();
|
||||
modification.tags = (tiddler.fields.tags || []).slice(0);
|
||||
modification.tags.splice(p,1);
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
|
||||
@ -100,7 +100,7 @@ FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) {
|
||||
FieldManglerWidget.prototype.handleAddTagEvent = function(event) {
|
||||
var tiddler = this.wiki.getTiddler(this.mangleTitle);
|
||||
if(tiddler && typeof event.param === "string" && event.param !== "") {
|
||||
var modification = {};
|
||||
var modification = this.wiki.getModificationFields();
|
||||
modification.tags = (tiddler.fields.tags || []).slice(0);
|
||||
$tw.utils.pushTop(modification.tags,event.param);
|
||||
this.wiki.addTiddler(new $tw.Tiddler(tiddler,modification));
|
||||
|
Loading…
Reference in New Issue
Block a user