Refactored editTask into TaskService

This commit is contained in:
Blade Barringer
2015-06-16 23:11:04 -05:00
parent 18fe4b6166
commit 3ab27f32d2
10 changed files with 176 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
"use strict";
habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state', '$stateParams',
function($rootScope, $scope, Shared, User, Challenges, Notification, $compile, Groups, $state, $stateParams) {
habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state', '$stateParams', 'Tasks',
function($rootScope, $scope, Shared, User, Challenges, Notification, $compile, Groups, $state, $stateParams, Tasks) {
// Use presence of cid to determine whether to show a list or a single
// challenge
@@ -49,6 +49,10 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
});
};
$scope.editTask = function(task) {
Tasks.editTask(task);
};
/**
* Create
*/

View File

@@ -1,7 +1,7 @@
"use strict";
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','Notification', '$http', 'ApiUrl', '$timeout', 'Shared', 'Guide',
function($scope, $rootScope, $location, User, Notification, $http, ApiUrl, $timeout, Shared, Guide) {
habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','Notification', '$http', 'ApiUrl', '$timeout', 'Shared', 'Guide', 'Tasks',
function($scope, $rootScope, $location, User, Notification, $http, ApiUrl, $timeout, Shared, Guide, Tasks) {
$scope.obj = User.user; // used for task-lists
$scope.user = User.user;
@@ -65,6 +65,10 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
list.focus = true;
};
$scope.editTask = function(task) {
Tasks.editTask(task);
};
/**
* Add the new task to the actions log
*/