mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Modify removeTask to accept a task object. Update task view to reflect new method signature.
This commit is contained in:
@@ -82,9 +82,9 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
}
|
||||
};
|
||||
|
||||
$scope.removeTask = function(list, $index) {
|
||||
$scope.removeTask = function(task) {
|
||||
if (!confirm(window.env.t('sureDelete'))) return;
|
||||
User.user.ops.deleteTask({params:{id:list[$index].id}})
|
||||
User.user.ops.deleteTask({params:{id:task.id}})
|
||||
};
|
||||
|
||||
$scope.saveTask = function(task, stayOpen, isSaveAndClose) {
|
||||
@@ -166,7 +166,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
focusChecklist(task,$index-1);
|
||||
// Don't allow the backspace key to navigate back now that the field is gone
|
||||
$event.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
$scope.swapChecklistItems = function(task, oldIndex, newIndex) {
|
||||
var toSwap = task.checklist.splice(oldIndex, 1)[0];
|
||||
@@ -186,7 +186,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
|
||||
/*
|
||||
------------------------
|
||||
Items
|
||||
Items
|
||||
------------------------
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user