mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 18:59:42 +00:00
7a7472833f
Fixes regression introduced in575c23359
. Fixes: #6119 See-also:575c23359
(Update untagged filter to avoid $tw.utils.pushTop (#6034), 2021-09-18)
30 lines
647 B
JavaScript
30 lines
647 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/untagged.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator returning all the selected tiddlers that are untagged
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.untagged = function(source,operator,options) {
|
|
var results = [],
|
|
expected = (operator.prefix === "!");
|
|
source(function(tiddler,title) {
|
|
if(((tiddler && $tw.utils.isArray(tiddler.fields.tags) && tiddler.fields.tags.length > 0) === expected) || (!tiddler && !expected)) {
|
|
results.push(title);
|
|
}
|
|
});
|
|
return results;
|
|
};
|
|
|
|
})();
|