mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +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:
@@ -174,12 +174,18 @@ angular.module('habitrpg')
|
||||
};
|
||||
|
||||
function editTask(task, user) {
|
||||
task._editing = !task._editing;
|
||||
task._editing = true;
|
||||
task._tags = !user.preferences.tagsCollapsed;
|
||||
task._advanced = !user.preferences.advancedCollapsed;
|
||||
task._edit = angular.copy(task);
|
||||
if($rootScope.charts[task._id]) $rootScope.charts[task.id] = false;
|
||||
}
|
||||
|
||||
function cancelTaskEdit(task) {
|
||||
task._edit = undefined;
|
||||
task._editing = false;
|
||||
};
|
||||
|
||||
function cloneTask(task) {
|
||||
var clonedTask = _.cloneDeep(task);
|
||||
clonedTask = _cleanUpTask(clonedTask);
|
||||
@@ -226,6 +232,7 @@ angular.module('habitrpg')
|
||||
unlinkAllTasks: unlinkAllTasks,
|
||||
clearCompletedTodos: clearCompletedTodos,
|
||||
editTask: editTask,
|
||||
cancelTaskEdit: cancelTaskEdit,
|
||||
cloneTask: cloneTask
|
||||
};
|
||||
}]);
|
||||
|
||||
Reference in New Issue
Block a user