mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Fixes Action-listops bug (#5644)
This commit is contained in:
parent
8203ee06c3
commit
e2379b599e
@ -44,9 +44,7 @@ ActionListopsWidget.prototype.execute = function() {
|
||||
*/
|
||||
ActionListopsWidget.prototype.refresh = function(changedTiddlers) {
|
||||
var changedAttributes = this.computeAttributes();
|
||||
if(changedAttributes.$tiddler || changedAttributes.$filter ||
|
||||
changedAttributes.$subfilter || changedAttributes.$field ||
|
||||
changedAttributes.$index || changedAttributes.$tags) {
|
||||
if($tw.utils.count(changedAttributes) > 0) {
|
||||
this.refreshSelf();
|
||||
return true;
|
||||
}
|
||||
@ -60,12 +58,10 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
||||
//Apply the specified filters to the lists
|
||||
var field = this.listField,
|
||||
index,
|
||||
type = "!!",
|
||||
list = this.listField;
|
||||
if(this.listIndex) {
|
||||
field = undefined;
|
||||
index = this.listIndex;
|
||||
type = "##";
|
||||
list = this.listIndex;
|
||||
}
|
||||
if(this.filter) {
|
||||
@ -74,15 +70,14 @@ ActionListopsWidget.prototype.invokeAction = function(triggeringWidget,
|
||||
.filterTiddlers(this.filter, this)));
|
||||
}
|
||||
if(this.subfilter) {
|
||||
var subfilter = "[list[" + this.target + type + list + "]] " + this.subfilter;
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(
|
||||
this.wiki
|
||||
.filterTiddlers(subfilter, this)));
|
||||
var inputList = this.wiki.getTiddlerList(this.target,field,index),
|
||||
subfilter = $tw.utils.stringifyList(inputList) + " " + this.subfilter;
|
||||
this.wiki.setText(this.target, field, index, $tw.utils.stringifyList(this.wiki.filterTiddlers(subfilter,this)));
|
||||
}
|
||||
if(this.filtertags) {
|
||||
var tiddler = this.wiki.getTiddler(this.target),
|
||||
oldtags = tiddler ? (tiddler.fields.tags || []).slice(0) : [],
|
||||
tagfilter = "[list[" + this.target + "!!tags]] " + this.filtertags,
|
||||
tagfilter = $tw.utils.stringifyList(oldtags) + " " + 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));
|
||||
|
Loading…
Reference in New Issue
Block a user