Skip to content
Snippets Groups Projects
Commit 9b0a5b12 authored by juanf's avatar juanf
Browse files

SSDM-12402: Bugfix, trascan to show wait feedback

parent b93873d6
No related branches found
No related tags found
1 merge request!5420.10.10.1
......@@ -153,7 +153,7 @@ var Util = new function() {
Util.showError(errorMessage, function() {Util.unblockUI();}, undefined, isUserFailureException || isAuthorizationException);
}
this.showWarning = function(text, okCallback) {
this.showWarning = function(text, okCallback, notUnblockOnAccept) {
var css = {
'text-align' : 'left',
'top' : '15%',
......@@ -169,7 +169,9 @@ var Util = new function() {
$("#warningAccept").on("click", function(event) {
okCallback();
Util.unblockUI();
if(!notUnblockOnAccept) {
Util.unblockUI();
}
});
$("#warningCancel").on("click", function(event) {
......
......@@ -20,27 +20,31 @@ function TrashManagerController(mainController) {
this._trashManagerView = new TrashManagerView(this, this._trashManagerModel);
this.revertDeletions = function(deletionIds) {
Util.blockUINoMessage();
Util.blockUI();
mainController.serverFacade.revertDeletions(deletionIds, function() {
Util.showSuccess("Deletions Reverted.", function() {});
mainController.changeView('showTrashcanPage', null);
Util.showSuccess("Deletions Reverted.", function() {
Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
});
}
this.deletePermanently = function(deletionIds, forceDeletionOfDependentDeletions) {
Util.blockUINoMessage();
Util.blockUI();
mainController.serverFacade.deletePermanently(deletionIds, forceDeletionOfDependentDeletions, function(data) {
if(data.error) {
Util.showError(data.error.message, null, true, true, false, true);
} else {
Util.showSuccess("Permanently Deleted.");
mainController.changeView('showTrashcanPage', null);
Util.showSuccess("Permanently Deleted.", function() {
Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
}
});
}
this.emptyTrash = function() {
Util.blockUINoMessage();
Util.blockUI();
var deleteIds = [];
for(var delIdx = 0; delIdx < this._trashManagerModel.deletions.length; delIdx++) {
......@@ -52,8 +56,10 @@ function TrashManagerController(mainController) {
if(data.error) {
Util.showError(data.error.message, null, true, true, false, true);
} else {
Util.showSuccess("Trashcan cleaned.");
mainController.changeView('showTrashcanPage', null);
Util.showSuccess("Trashcan cleaned.", function() {
Util.unblockUI();
mainController.changeView('showTrashcanPage', null);
});
}
});
}
......
......@@ -32,7 +32,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
deleteAllBtn.click(function() {
Util.showWarning(deleteMessageMany, function() {
_this._trashManagerController.emptyTrash();
});
}, true);
});
$header.append($("<h1>").append("Trashcan"));
......@@ -104,7 +104,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
$removeOption.click(function(e) {
Util.showWarning(deleteMessageOne, function() {
_this._trashManagerController.deletePermanently([data.entity.id], false);
});
}, true);
});
$list.append($removeOption);
......@@ -113,7 +113,7 @@ function TrashManagerView(trashManagerController, trashManagerModel) {
$removeIncludedOption.click(function(e) {
Util.showWarning(deleteMessageOne, function() {
_this._trashManagerController.deletePermanently([data.entity.id], true);
});
}, true);
});
$list.append($removeIncludedOption);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment