Files
edx-platform/cms/static/js/utils/module.js
Eric Fischer 5bc6b31e29 eslint --fix
2017-12-08 14:38:41 -05:00

25 lines
583 B
JavaScript

/**
* Utilities for modules/xblocks.
*
* Returns:
*
* urlRoot: the root for creating/updating an xblock.
* getUpdateUrl: a utility method that returns the xblock update URL, appending
* the location if passed in.
*/
define(['underscore'], function(_) {
var urlRoot = '/xblock';
var getUpdateUrl = function(locator) {
if (_.isUndefined(locator)) {
return urlRoot + '/';
} else {
return urlRoot + '/' + locator;
}
};
return {
urlRoot: urlRoot,
getUpdateUrl: getUpdateUrl
};
});