From 09761c5c537ad3d195280d4e1767bb9b02b23bfa Mon Sep 17 00:00:00 2001 From: TheHollidayInn Date: Tue, 7 Apr 2015 14:51:26 -0500 Subject: [PATCH] Corrected ordering that tasks appear in when user enters multiple tasks --- website/public/js/controllers/tasksCtrl.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/public/js/controllers/tasksCtrl.js b/website/public/js/controllers/tasksCtrl.js index 95b6f0bee7..153dd86f28 100644 --- a/website/public/js/controllers/tasksCtrl.js +++ b/website/public/js/controllers/tasksCtrl.js @@ -38,7 +38,10 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N $scope.addTask = function(addTo, listDef) { if (listDef.bulk) { var tasks = listDef.newTask.split(/[\n\r]+/); + //Reverse the order of tasks so the tasks will appear in the order the user entered them + tasks.reverse(); _.each(tasks, function(t) { + console.log(t) addTask(addTo, listDef, t); }); listDef.bulk = false; @@ -166,7 +169,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N focusChecklist(task,$index-1); // Don't allow the backspace key to navigate back now that the field is gone $event.preventDefault(); - } + } } $scope.swapChecklistItems = function(task, oldIndex, newIndex) { var toSwap = task.checklist.splice(oldIndex, 1)[0]; @@ -186,7 +189,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N /* ------------------------ - Items + Items ------------------------ */