mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user