mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
25 lines
477 B
JavaScript
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
|
||
|
|
};
|
||
|
|
}
|