diff vendor/plugins/redmine_bibliography/assets/javascripts/authors.js @ 518:b24091590b63 feature_36

virtual attribute to handle users; javascript handling users correctly
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 14 Jul 2011 17:10:24 +0100
parents ea8b8768b4a0
children 724c97fc03dc
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Thu Jul 07 18:20:31 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Thu Jul 14 17:10:24 2011 +0100
@@ -12,9 +12,12 @@
 }
 
 function update_author_info(link, author_info){
+		
 	$(link).up('div').up('div').select('input[id^=publication_authorships_attributes]').each(
 		function(e){
-			key = e.name.split("[").last().trim().sub(']','');			
+			key = e.name.split("[").last().trim().sub(']','');
+			
+			// test for undefined			
 			e.value = author_info[key];
 		}		
 	)