rewrite: add-task bug fix, add to separate columns

This commit is contained in:
Tyler Renelle
2013-08-28 11:50:34 -04:00
parent ddf3cd3ac9
commit de5837462a
2 changed files with 7 additions and 14 deletions
+6 -13
View File
@@ -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
*/
+1 -1
View File
@@ -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')