mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-13 12:47:28 +01:00
Fixed lint issues with model in task services (#8523)
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
var TASK_KEYS_TO_REMOVE = ['_id', 'completed', 'date', 'dateCompleted', 'history', 'id', 'streak', 'createdAt', 'challenge'];
|
||||
|
||||
angular.module('habitrpg')
|
||||
.factory('Tasks', ['$rootScope', 'Shared', '$http',
|
||||
function tasksFactory($rootScope, Shared, $http) {
|
||||
.factory('Tasks', ['$rootScope', 'Shared', '$http', '$modal',
|
||||
function tasksFactory($rootScope, Shared, $http, $modal) {
|
||||
function addTasks(listDef, addTaskFn) {
|
||||
var tasks = listDef.newTask;
|
||||
|
||||
@@ -256,6 +256,7 @@ angular.module('habitrpg')
|
||||
};
|
||||
|
||||
function editTask(task, user, taskStatus, scopeInc) {
|
||||
// @TODO: This should be it's own controller. And methods should be abstracted form the three task ctrls to a directive/ctrl
|
||||
var modalScope = $rootScope.$new();
|
||||
modalScope.task = task;
|
||||
modalScope.task._editing = true;
|
||||
@@ -286,9 +287,10 @@ angular.module('habitrpg')
|
||||
modalScope.task._edit.repeatsOn = 'dayOfWeek';
|
||||
}
|
||||
|
||||
$rootScope.openModal('task-edit', {
|
||||
$modal.open({
|
||||
scope: modalScope,
|
||||
controller: function ($scope) {
|
||||
templateUrl: 'modals/task-edit.html',
|
||||
controller: ['$scope', function ($scope) {
|
||||
$scope.$watch('task._edit', function (newValue, oldValue) {
|
||||
if ($scope.task.type !== 'daily') return;
|
||||
$scope.summary = generateSummary($scope.task);
|
||||
@@ -311,7 +313,7 @@ angular.module('habitrpg')
|
||||
$scope.task._edit.repeat[shortDay] = true;
|
||||
}
|
||||
}, true);
|
||||
},
|
||||
}],
|
||||
})
|
||||
.result.catch(function() {
|
||||
cancelTaskEdit(task);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
script(id='modals/task-notes.html', type='text/ng-template')
|
||||
script(type='text/ng-template', id='modals/task-notes.html')
|
||||
.modal-header
|
||||
h4 Task Notes
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
script(type='text/ng-template', id='modals/task-edit.html')
|
||||
.modal-content.task-modal(style='min-width:22em', class='{{taskStatus}}', id="task-{{task._id}}")
|
||||
.modal-body.text-center(style='padding-bottom:0')
|
||||
| {{scope}}
|
||||
include ../tasks/edit/index
|
||||
.modal-footer(style='margin-top:0')
|
||||
.container-fluid
|
||||
|
||||
Reference in New Issue
Block a user