Merge branch 'develop' into Hus274-7688

This commit is contained in:
Blade Barringer
2016-08-20 08:31:22 -04:00
1104 changed files with 45010 additions and 31088 deletions

View File

@@ -28,7 +28,6 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
}
User.score({params:{task: task, direction:direction}});
Analytics.updateUser();
Analytics.track({'hitType':'event','eventCategory':'behavior','eventAction':'score task','taskType':task.type,'direction':direction});
};
function addTask(addTo, listDef, tasks) {
@@ -68,6 +67,25 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
list.focus = true;
};
$scope.editTask = Tasks.editTask;
$scope.canEdit = function(task) {
// can't edit challenge tasks
return !task.challenge.id;
}
$scope.doubleClickTask = function (obj, task) {
if (obj._locked) {
return false;
}
if (task._editing) {
$scope.saveTask(task);
} else {
$scope.editTask(task);
}
}
/**
* Add the new task to the actions log
*/
@@ -98,8 +116,6 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
}
};
$scope.editTask = Tasks.editTask;
$scope.saveTask = function(task, stayOpen, isSaveAndClose) {
angular.copy(task._edit, task);
task._edit = undefined;
@@ -157,7 +173,11 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
$scope._today = moment().add({days: 1});
$scope.loadedCompletedTodos = function () {
if (Tasks.loadedCompletedTodos === true) return;
if (Tasks.loadedCompletedTodos === true) {
return;
}
User.user.todos = _.reject(User.user.todos, 'completed')
Tasks.getUserTasks(true)
.then(function (response) {