mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-09-09 06:16:06 +00:00
Adjust listops widget to only modify tiddler if tags have changed
We do this so that we don’t accidentally modify shadow tiddlers when we drag them to reorder them within their tag parent. Otherwise, moving a toolbar button like $:/core/ui/Buttons/permaview in the control panel will override the shadow tiddler.
This commit is contained in:
@@ -80,9 +80,13 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
||||
.filterTiddlers(subfilter, this)));
|
||||
}
|
||||
if(this.filtertags) {
|
||||
var tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags;
|
||||
this.wiki.setText(this.target, "tags", undefined, $tw.utils.stringifyList(
|
||||
this.wiki.filterTiddlers(tagfilter, this)));
|
||||
var tiddler = this.wiki.getTiddler(this.target),
|
||||
oldtags = tiddler ? (tiddler.fields.tags || []).slice(0) : [],
|
||||
tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags,
|
||||
newtags = this.wiki.filterTiddlers(tagfilter,this);
|
||||
if($tw.utils.stringifyList(oldtags.sort()) !== $tw.utils.stringifyList(newtags.sort())) {
|
||||
this.wiki.setText(this.target,"tags",undefined,$tw.utils.stringifyList(newtags));
|
||||
}
|
||||
}
|
||||
return true; // Action was invoked
|
||||
};
|
||||
|
Reference in New Issue
Block a user