From 8906cffb22470f965bb699f2fff06c114f977b71 Mon Sep 17 00:00:00 2001 From: David Baumgold Date: Wed, 9 Oct 2013 11:26:34 -0400 Subject: [PATCH] correct placement of baseUrl variable, use it to configure requirejs --- common/static/js/capa/drag_and_drop.js | 5 +++++ lms/templates/main.html | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/static/js/capa/drag_and_drop.js b/common/static/js/capa/drag_and_drop.js index c587b1c54a..a23138235a 100644 --- a/common/static/js/capa/drag_and_drop.js +++ b/common/static/js/capa/drag_and_drop.js @@ -4,6 +4,11 @@ // See https://edx-wiki.atlassian.net/wiki/display/LMS/Integration+of+Require+JS+into+the+system (function (requirejs, require, define) { +// HACK: this should be removed when it is safe to do so +if(window.baseUrl) { + requirejs.config({baseUrl: baseUrl}); +} + // The current JS file will be loaded and run each time. It will require a // single dependency which will be loaded and stored by RequireJS. On // subsequent runs, RequireJS will return the dependency from memory, rather diff --git a/lms/templates/main.html b/lms/templates/main.html index c689ad4e02..353141f50b 100644 --- a/lms/templates/main.html +++ b/lms/templates/main.html @@ -36,7 +36,6 @@ if (window.location !== window.top.location) { window.top.location = window.location; } - window.baseUrl = "${settings.STATIC_URL}"; })(this); % endif @@ -96,6 +95,7 @@ <%include file="footer.html" /> % endif + <%static:js group='application'/> <%static:js group='module-js'/>