mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 10:49:43 +00:00
385c7e207c
Now we pass a widget instead of the current tiddler title. We can use widget.getVariable(“currentTiddler”) to get the current tiddler.
28 lines
503 B
JavaScript
28 lines
503 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/all/current.js
|
|
type: application/javascript
|
|
module-type: allfilteroperator
|
|
|
|
Filter function for [all[current]]
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.current = function(source,prefix,options) {
|
|
var currTiddlerTitle = options.widget && options.widget.getVariable("currentTiddler");
|
|
if(currTiddlerTitle) {
|
|
return [currTiddlerTitle];
|
|
} else {
|
|
return [];
|
|
}
|
|
};
|
|
|
|
})();
|