mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Added support for grouping tasks by challenge (#8469)
* Added support for grouping tasks by chllenge * Fixed tests and updated default challenge model name * Fixed broken member test * Updated setting string * Changed to shortName * Began abstracting task grouping * Added initial task directive code * Added new directives to help with grouping of tasks * Removed random console.log
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
habitrpg.controller('GroupTasksCtrl', ['$scope', 'Shared', 'Tasks', 'User', function ($scope, Shared, Tasks, User) {
|
||||
habitrpg.controller('GroupTasksCtrl', ['$scope', 'Shared', 'Tasks', 'User', '$rootScope', function ($scope, Shared, Tasks, User, $rootScope) {
|
||||
function handleGetGroupTasks (response) {
|
||||
var group = $scope.obj;
|
||||
|
||||
@@ -15,8 +15,9 @@ habitrpg.controller('GroupTasksCtrl', ['$scope', 'Shared', 'Tasks', 'User', func
|
||||
tasks.forEach(function (element, index, array) {
|
||||
if (!$scope.group[element.type + 's']) $scope.group[element.type + 's'] = [];
|
||||
$scope.group[element.type + 's'].unshift(element);
|
||||
})
|
||||
});
|
||||
|
||||
$rootScope.$broadcast('obj-updated', $scope.group);
|
||||
$scope.loading = false;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user