1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-12-07 01:08:06 +00:00
* corrected [!is[draft]] to be a proper complement

* Ensuring [is[draft]] and [!is[draft]] are complements

* Made [is[draft]] more analogous to .isDraft()
This commit is contained in:
Cameron Fischer
2022-02-22 11:41:29 -05:00
committed by GitHub
parent 95bd694a65
commit d0b5b2124a
2 changed files with 30 additions and 2 deletions

View File

@@ -19,13 +19,13 @@ exports.draft = function(source,prefix,options) {
var results = [];
if(prefix === "!") {
source(function(tiddler,title) {
if(!tiddler || !$tw.utils.hop(tiddler.fields,"draft.of")) {
if(!tiddler || !tiddler.isDraft()) {
results.push(title);
}
});
} else {
source(function(tiddler,title) {
if(tiddler && $tw.utils.hop(tiddler.fields,"draft.of") && (tiddler.fields["draft.of"].length !== 0)) {
if(tiddler && tiddler.isDraft()) {
results.push(title);
}
});