Skip to content

Commit

Permalink
Should fix underscore.string issues on pages not explicitly requiring it
Browse files Browse the repository at this point in the history
  • Loading branch information
bjacobel committed Apr 1, 2016
1 parent 41adf01 commit 6e0415c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@
'js/vendor/jquery.cookie.js',
'js/vendor/url.min.js',
'common/js/vendor/underscore.js',
'js/vendor/underscore.string.min.js',
'common/js/vendor/underscore.string.js',

# Make some edX UI Toolkit utilities available in the global "edx" namespace
'edx-ui-toolkit/js/utils/global-loader.js',
Expand Down
10 changes: 5 additions & 5 deletions lms/static/lms/js/require-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
};
defineDependency("jQuery", "jquery");
defineDependency("_", "underscore");
if (window._ && window._.str) {
define("underscore.string", [], function () {return window._.str;});
}
else {
console.error("Expected _.str (underscore.string) to be on the window object, but not found.");
defineDependency("s", "underscore.string");
// Underscore.string no longer installs itself directly on "_". For compatibility with existing
// code, add it to "_" with its previous name.
if (window._ && window.s) {
window._.str = window.s;
}
defineDependency("gettext", "gettext");
defineDependency("Logger", "logger");
Expand Down

0 comments on commit 6e0415c

Please sign in to comment.