mirror of
https://github.com/S2-/ejs-render-remote
synced 2025-08-03 21:10:04 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
4dd2bfb8a9 | |||
b6e19487b7 |
@@ -14,12 +14,6 @@
|
||||
|
||||
//if the template is already cached, return it and we are done
|
||||
if (templateFn) {
|
||||
//but first check if there is still a getter function for this template in the cache
|
||||
//if yes, remove it so we clean up a bit
|
||||
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
|
||||
ejs.cache.remove('getFnFor' + templateUrl);
|
||||
}
|
||||
|
||||
return templateFn(data);
|
||||
|
||||
} else { //if the template is not cached, we need to get it and render it later once we have it. remember: this happens only if the template is not already cached
|
||||
@@ -41,6 +35,11 @@
|
||||
filename: templateUrl
|
||||
}
|
||||
));
|
||||
|
||||
//clean up the getFnFor
|
||||
if (ejs.cache.remove && ejs.cache.get('getFnFor' + templateUrl)) {
|
||||
ejs.cache.remove('getFnFor' + templateUrl);
|
||||
}
|
||||
});
|
||||
|
||||
return '<span class="ejs-templateplaceholder" style="display: none;" id="' + r + '"></span>';
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ejs-render-remote",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.4",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"homepage": "https://github.com/S2-/ejs-render-remote",
|
||||
|
Reference in New Issue
Block a user