mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-28 11:00:27 +00:00
Allow filter operators to return an iterator
Previously filter operators were only permitted to return an array of tiddler titles
This commit is contained in:
parent
bd3e955821
commit
21b2d6fdc7
@ -203,9 +203,21 @@ exports.compileFilter = function(filterString) {
|
||||
wiki: self,
|
||||
widget: widget
|
||||
});
|
||||
accumulator = self.makeTiddlerIterator(results);
|
||||
if($tw.utils.isArray(results)) {
|
||||
accumulator = self.makeTiddlerIterator(results);
|
||||
} else {
|
||||
accumulator = results;
|
||||
}
|
||||
});
|
||||
return results;
|
||||
if($tw.utils.isArray(results)) {
|
||||
return results;
|
||||
} else {
|
||||
var resultArray = [];
|
||||
results(function(tiddler,title) {
|
||||
resultArray.push(title);
|
||||
});
|
||||
return resultArray;
|
||||
}
|
||||
};
|
||||
// Wrap the operator functions in a wrapper function that depends on the prefix
|
||||
operationFunctions.push((function() {
|
||||
|
Loading…
Reference in New Issue
Block a user