mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: back to dealing with taskLists from scopes, rather than the
habitrpg-tasks directive. Was having trouble accessing it by reference otherwise. Would love to move off of the directive entirely and use ng-include instead, but some scope issues with lists
This commit is contained in:
@@ -73,11 +73,11 @@ habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notifica
|
||||
// Tasks
|
||||
//------------------------------------------------------------
|
||||
|
||||
$scope.addTask = function(list) {
|
||||
var task = window.habitrpgShared.helpers.taskDefaults({text: list.newTask, type: list.type}, User.user.filters);
|
||||
list.tasks.unshift(task);
|
||||
$scope.addTask = function(addTo, listDef) {
|
||||
var task = window.habitrpgShared.helpers.taskDefaults({text: listDef.newTask, type: listDef.type});
|
||||
addTo.unshift(task);
|
||||
//User.log({op: "addTask", data: task}); //TODO persist
|
||||
delete list.newTask;
|
||||
delete listDef.newTask;
|
||||
};
|
||||
|
||||
$scope.removeTask = function(list, $index) {
|
||||
|
||||
Reference in New Issue
Block a user