Commit 41ca47ed by Don Mitchell

Add flag to turn template caching on/off (default to off)

parent 113c99e0
...@@ -15,6 +15,10 @@ $(document).ready(function() { ...@@ -15,6 +15,10 @@ $(document).ready(function() {
// pipelining (note, this doesn't happen on local runtimes). So if we set it on window, when we can access it from other // pipelining (note, this doesn't happen on local runtimes). So if we set it on window, when we can access it from other
// scopes (namely the course-info tab) // scopes (namely the course-info tab)
window.$modalCover = $modalCover; window.$modalCover = $modalCover;
// Control whether template caching in local memory occurs (see template_loader.js). Caching screws up development but may
// be a good optimization in production (it works fairly well)
window.cachetemplates = false;
$body.append($modalCover); $body.append($modalCover);
$newComponentItem = $('.new-component-item'); $newComponentItem = $('.new-component-item');
......
...@@ -35,7 +35,8 @@ ...@@ -35,7 +35,8 @@
localStorageAvailable: function() { localStorageAvailable: function() {
try { try {
return 'localStorage' in window && window['localStorage'] !== null; // window.cachetemplates is global set in base.js to turn caching on/off
return window.cachetemplates && 'localStorage' in window && window['localStorage'] !== null;
} catch (e) { } catch (e) {
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment