diff vendor/plugins/redmine_bibliography/assets/javascripts/authors.js @ 468:0bb9c7baed07 feature_36

dynamically adding/removing users.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 23 Jun 2011 18:52:30 +0100
parents c1ecc16cf38e
children ae87ae455cfb
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Wed Jun 22 19:42:31 2011 +0100
+++ b/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js	Thu Jun 23 18:52:30 2011 +0100
@@ -1,4 +1,10 @@
 function remove_author(link){
-	$(link).previous("input[type=hidden]").value = 1;
-	$(link).up(".author_fields").hide();
+	$(link).previous('input[type=hidden]').value = 1;
+	$(link).up('.author_fields').remove();
+}
+
+function add_fields(link, association, content) {
+  var new_id = new Date().getTime();
+  var regexp = new RegExp("new_" + association, "g")
+  $(link).parent().before(content.replace(regexp, new_id));
 }
\ No newline at end of file