fixes task edit cancellation commit (#7931)

* fixes the commit that shows actual task values when task edit is canceled.

This reverts commit 3d64f2b849.

* removing _edit references from fields of a task that can't change and are always set

* removing _edit from task.type as type cannot change while editing.

* Addressing comments by blade
This commit is contained in:
Travis
2016-09-12 19:23:23 -07:00
committed by Blade Barringer
parent 289b5c2a42
commit bbf15e1756
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;