Add static HtmlUtils/StringUtils into edx namespace
This is a temporary workaround for code that needs access to these classes from the UI Toolkit but without using RequireJS.
This commit is contained in:
@@ -1 +1,21 @@
|
||||
define(['domReady!', 'jquery', 'backbone', 'underscore', 'gettext']);
|
||||
define([
|
||||
'edx-ui-toolkit/js/utils/string-utils',
|
||||
'edx-ui-toolkit/js/utils/html-utils',
|
||||
'domReady!',
|
||||
'jquery',
|
||||
'backbone',
|
||||
'underscore',
|
||||
'gettext'
|
||||
],
|
||||
function(StringUtils, HtmlUtils) {
|
||||
'use strict';
|
||||
|
||||
// Install utility classes in the edX namespace to make them
|
||||
// available to code that doesn't use RequireJS,
|
||||
// e.g. XModules and XBlocks.
|
||||
if (window) {
|
||||
window.edx = window.edx || {};
|
||||
window.edx.StringUtils = StringUtils;
|
||||
window.edx.HtmlUtils = HtmlUtils;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user