Refactor wiki.filterTiddlers()

Now we pass a widget instead of the current tiddler title. We can use
widget.getVariable(“currentTiddler”) to get the current tiddler.
This commit is contained in:
Jermolene
2014-04-27 20:03:33 +01:00
parent 61c204366f
commit 385c7e207c
7 changed files with 30 additions and 32 deletions

View File

@@ -60,14 +60,8 @@ EncryptWidget.prototype.execute = function() {
Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering
*/
EncryptWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes(),
affectedTiddlers = this.wiki.filterTiddlers(this.filter,null,changedTiddlers);
if(changedAttributes.filter || affectedTiddlers.length > 0) {
this.refreshSelf();
return true;
} else {
return false;
}
// We don't need to worry about refreshing because the encrypt widget isn't for interactive use
return false;
};
exports.encrypt = EncryptWidget;