Fix delete messages in course outline

STUD-2019
This commit is contained in:
Ben McMorran
2014-07-29 16:32:48 -04:00
committed by cahrens
parent 9d44417ccb
commit ce06e7f7e7
2 changed files with 17 additions and 10 deletions

View File

@@ -67,14 +67,20 @@ define(["jquery", "underscore", "gettext", "js/views/utils/view_utils", "js/util
/**
* Deletes the specified xblock.
* @param xblockInfo The model for the xblock to be deleted.
* @param xblockType A string representing the type of the xblock to be deleted.
* @returns {jQuery promise} A promise representing the deletion of the xblock.
*/
deleteXBlock = function(xblockInfo) {
deleteXBlock = function(xblockInfo, xblockType) {
var deletion = $.Deferred(),
url = ModuleUtils.getUpdateUrl(xblockInfo.id);
ViewUtils.confirmThenRunOperation(gettext('Delete this component?'),
gettext('Deleting this component is permanent and cannot be undone.'),
gettext('Yes, delete this component'),
url = ModuleUtils.getUpdateUrl(xblockInfo.id),
xblockType = xblockType || gettext('component');
ViewUtils.confirmThenRunOperation(
interpolate(gettext('Delete this %(xblock_type)s?'), { xblock_type: xblockType }, true),
interpolate(
gettext('Deleting this %(xblock_type)s is permanent and cannot be undone.'),
{ xblock_type: xblockType }, true
),
interpolate(gettext('Yes, delete this %(xblock_type)s'), { xblock_type: xblockType }, true),
function() {
ViewUtils.runOperationShowingMessage(gettext('Deleting…'),
function() {