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:
Tyler Renelle
2013-10-29 19:07:39 -07:00
parent 02ebc536ca
commit 6e71a76e22
7 changed files with 37 additions and 45 deletions

View File

@@ -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) {