Clear caches when changing plugins

print-window-tiddler
Jermolene 2015-08-02 22:22:33 +01:00
rodzic bc0d8c7c65
commit 9168480d18
2 zmienionych plików z 10 dodań i 4 usunięć

Wyświetl plik

@ -1083,6 +1083,8 @@ $tw.Wiki = function(options) {
});
}
});
this.clearCache(null);
this.clearGlobalCache();
};
};

Wyświetl plik

@ -742,11 +742,15 @@ exports.getCacheForTiddler = function(title,cacheName,initializer) {
}
};
// Clear all caches associated with a particular tiddler
// Clear all caches associated with a particular tiddler, or, if the title is null, clear all the caches for all the tiddlers
exports.clearCache = function(title) {
this.caches = this.caches || Object.create(null);
if($tw.utils.hop(this.caches,title)) {
delete this.caches[title];
if(title) {
this.caches = this.caches || Object.create(null);
if($tw.utils.hop(this.caches,title)) {
delete this.caches[title];
}
} else {
this.caches = Object.create(null);
}
};