Fixes U4-8845 - Double-click on confirm delete, deletes from bin as well

http://issues.umbraco.org/issue/U4-8845
This commit is contained in:
theotron
2016-08-12 14:39:12 +01:00
parent de2d4bef13
commit a3c457e50b
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) {