rewrite: add-task bug fix, add to separate columns
This commit is contained in:
@@ -70,20 +70,13 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', '
|
||||
dir: direction
|
||||
});
|
||||
};
|
||||
$scope.addTask = function(text) {
|
||||
var newTask;
|
||||
newTask = window.habitrpgShared.helpers.taskDefaults({
|
||||
text: text
|
||||
});
|
||||
User.user[newTask.type + "s"].unshift(newTask);
|
||||
/* $scope.showedTasks.unshift newTask # FIXME what's thiss?
|
||||
*/
|
||||
|
||||
User.log({
|
||||
op: "addTask",
|
||||
data: newTask
|
||||
});
|
||||
delete $scope.list.newTask;
|
||||
$scope.addTask = function(list) {
|
||||
var task = window.habitrpgShared.helpers.taskDefaults({text: list.newTask, type: list.type});
|
||||
User.user[list.type + "s"].unshift(task);
|
||||
// $scope.showedTasks.unshift newTask # FIXME what's thiss?
|
||||
User.log({op: "addTask", data: task});
|
||||
delete list.newTask;
|
||||
};
|
||||
/*Add the new task to the actions log
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ div(ng-controller='TasksCtrl')
|
||||
.todos-chart(ng-if='list.type == "todo"', ng-show='_page.charts.todos')
|
||||
|
||||
// Add New
|
||||
form.addtask-form.form-inline.new-task-form(name='new{{list.type}}form', ng-show='list.editable', ng-hide='list.showCompleted && list.type=="todo"', data-task-type='{{list.type}}', ng-submit='addTask(list.newTask)')
|
||||
form.addtask-form.form-inline.new-task-form(name='new{{list.type}}form', ng-show='list.editable', ng-hide='list.showCompleted && list.type=="todo"', data-task-type='{{list.type}}', ng-submit='addTask(list)')
|
||||
span.addtask-field
|
||||
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', required)
|
||||
input.addtask-btn(type='submit', value='+', ng-disabled='new{{list.type}}form.$invalid')
|
||||
|
||||
Reference in New Issue
Block a user