Files
edx-platform/cms/static/js/utils/module.js
Calen Pennington cd862b3253 Merge remote-tracking branch 'edx/master' into opaque-keys
Conflicts:
	cms/djangoapps/contentstore/tests/test_contentstore.py
	cms/djangoapps/contentstore/views/component.py
	cms/djangoapps/contentstore/views/item.py
	cms/djangoapps/contentstore/views/preview.py
	cms/djangoapps/contentstore/views/tests/test_container.py
	cms/static/js/spec/views/unit_spec.js
	cms/static/js/utils/module.js
	cms/templates/container.html
	cms/templates/studio_vertical_wrapper.html
	cms/templates/studio_xblock_wrapper.html
	common/djangoapps/student/views.py
	lms/templates/notes.html
	lms/templates/textannotation.html
	lms/templates/videoannotation.html
2014-05-22 10:52:00 -04:00

32 lines
699 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) {
<<<<<<< HEAD
if (locator === undefined) {
return urlRoot + "/";
=======
if (_.isUndefined(locator)) {
return urlRoot;
>>>>>>> edx/master
}
else {
return urlRoot + "/" + locator;
}
};
return {
urlRoot: urlRoot,
getUpdateUrl: getUpdateUrl
};
});