[seam-commits] Seam SVN: r14148 - branches/enterprise/JBPAPP_5_0/examples/tasks/view.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Aug 12 07:27:53 EDT 2011


Author: jharting
Date: 2011-08-12 07:27:53 -0400 (Fri, 12 Aug 2011)
New Revision: 14148

Modified:
   branches/enterprise/JBPAPP_5_0/examples/tasks/view/tasks.js
Log:
JBPAPP-5039

Modified: branches/enterprise/JBPAPP_5_0/examples/tasks/view/tasks.js
===================================================================
--- branches/enterprise/JBPAPP_5_0/examples/tasks/view/tasks.js	2011-08-11 14:57:17 UTC (rev 14147)
+++ branches/enterprise/JBPAPP_5_0/examples/tasks/view/tasks.js	2011-08-12 11:27:53 UTC (rev 14148)
@@ -6,7 +6,7 @@
 		postTask(categoryName, name, function(location) {
 			$('#editTaskName').val('');
 			$.get(location, function(data) {
-				addTask($(data).find('task'), categoryName);
+				addTaskFromXML($(data).find('task'), categoryName);
 			});
 		});
 	});
@@ -27,7 +27,7 @@
 					updateTaskNameOnUI(taskId, taskName); // just update the name
 				} else {
 					$('#' + taskId).remove(); // add the task into new category
-					addTask(data, newCategoryName);
+					addTask(taskId, taskName, newCategoryName);
 				}
 		}
 		putTask(newCategoryName, taskId, taskName, false, callback);
@@ -57,15 +57,18 @@
 	$('<option/>').attr('value', categoryName).text(categoryName).appendTo('#editTaskCategory');
 	getTasksForCategory(categoryName, false, function(data) {
 		$(data).find('task').each(function() {
-			addTask($(this), categoryName);
+			addTaskFromXML($(this), categoryName);
 	 	});
 	});
 }
 
-function addTask(task, categoryName) {
+function addTaskFromXML(task, categoryName) {
 	var taskId = $(task).find('id').text();
 	var taskName = $(task).find('name').text();
-	
+	addTask(taskId, taskName, categoryName);
+}
+
+function addTask(taskId, taskName, categoryName) {
 	var parent = $('[id=' + categoryName + ']');
 	var nameCell = $('<td/>').append($('<span/>').addClass('name').text(taskName));
 	var doneButton = $('<img/>').attr('src', 'img/task-done.png').attr('title', 'Resolve this task').click(function(event) {



More information about the seam-commits mailing list