Files
habitica/website/public/js/services/taskServices.js
2015-06-16 23:11:04 -05:00

25 lines
477 B
JavaScript

'use strict';
angular
.module('habitrpg')
.factory('Tasks', tasksFactory);
tasksFactory.$inject = [
'$rootScope',
'User'
];
function tasksFactory($rootScope, User) {
function editTask(task) {
task._editing = !task._editing;
task._tags = !User.user.preferences.tagsCollapsed;
task._advanced = !User.user.preferences.advancedCollapsed;
if($rootScope.charts[task.id]) $rootScope.charts[task.id] = false;
}
return {
editTask: editTask
};
}