Merge branch 'MDL-68677-38' of git://github.com/andrewnicols/moodle into MOODLE_38_STABLE
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -79,11 +79,6 @@ define([
|
||||
* @return {Object} jQuery promise resolved with the template source
|
||||
*/
|
||||
var getTemplatePromiseFromCache = function(searchKey) {
|
||||
// Do not cache anything if templaterev is not valid.
|
||||
if (M.cfg.templaterev <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// First try the cache of promises.
|
||||
if (searchKey in templatePromises) {
|
||||
return templatePromises[searchKey];
|
||||
@@ -96,6 +91,11 @@ define([
|
||||
return templatePromises[searchKey];
|
||||
}
|
||||
|
||||
if (M.cfg.templaterev <= 0) {
|
||||
// Template caching is disabled. Do not store in persistent storage.
|
||||
return null;
|
||||
}
|
||||
|
||||
// Now try local storage.
|
||||
var cached = storage.get('core_template/' + M.cfg.templaterev + ':' + searchKey);
|
||||
if (cached) {
|
||||
@@ -183,7 +183,11 @@ define([
|
||||
// Cache all of the dependent templates because we'll need them to render
|
||||
// the requested template.
|
||||
templateCache[tempSearchKey] = data.value;
|
||||
storage.set('core_template/' + M.cfg.templaterev + ':' + tempSearchKey, data.value);
|
||||
|
||||
if (M.cfg.templaterev > 0) {
|
||||
// The template cache is enabled - set the value there.
|
||||
storage.set('core_template/' + M.cfg.templaterev + ':' + tempSearchKey, data.value);
|
||||
}
|
||||
|
||||
if (data.component == component && data.name == name) {
|
||||
// This is the original template that was requested so remember it to return.
|
||||
|
||||
Reference in New Issue
Block a user