Revert "Revert "fixes task edit cancellation commit (#7931)""

This reverts commit 2da9876e42.
This commit is contained in:
Blade Barringer
2016-09-13 11:52:47 -05:00
parent 25aaa351ee
commit cbefc13e25
12 changed files with 100 additions and 77 deletions

View File

@@ -35,6 +35,7 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
}
$scope.editTask = Tasks.editTask;
$scope.cancelTaskEdit = Tasks.cancelTaskEdit;
$scope.canEdit = function(task) {
return true;
@@ -304,8 +305,10 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
};
$scope.saveTask = function(task){
Tasks.updateTask(task._id, task);
angular.copy(task._edit, task);
task._edit = undefined;
task._editing = false;
Tasks.updateTask(task._id, task);
}
$scope.toggleBulk = Tasks.toggleBulk;