Merge pull request #1432 from theotron/U4-8845

U4-8845 - Prevents double-click on confirm delete from deleting from bin
This commit is contained in:
Mads Rasmussen
2016-08-16 09:50:47 +02:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -10,8 +10,12 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio
$scope.performDelete = function() {
// stop from firing again on double-click
if ($scope.busy) { return false; }
//mark it for deletion (used in the UI)
$scope.currentNode.loading = true;
$scope.busy = true;
contentResource.deleteById($scope.currentNode.id).then(function () {
$scope.currentNode.loading = false;
@@ -44,6 +48,7 @@ function ContentDeleteController($scope, contentResource, treeService, navigatio
}, function(err) {
$scope.currentNode.loading = false;
$scope.busy = false;
//check if response is ysod
if (err.status && err.status >= 500) {

View File

@@ -10,8 +10,12 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
$scope.performDelete = function() {
// stop from firing again on double-click
if ($scope.busy) { return false; }
//mark it for deletion (used in the UI)
$scope.currentNode.loading = true;
$scope.busy = true;
mediaResource.deleteById($scope.currentNode.id).then(function () {
$scope.currentNode.loading = false;
@@ -45,6 +49,7 @@ function MediaDeleteController($scope, mediaResource, treeService, navigationSer
}, function (err) {
$scope.currentNode.loading = false;
$scope.busy = false;
//check if response is ysod
if (err.status && err.status >= 500) {