changeset 1276:20a6b12d1aba redmine-2.2-integration

Fixed test that was checking if an element belonged to the array. Correctly showing/hiding the Bibtex fields.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Fri, 10 May 2013 11:50:40 +0100
parents 1194982f28ba
children 99fe7b784587
files plugins/redmine_bibliography/app/views/publications/show_bibtex_fields.js.erb
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/redmine_bibliography/app/views/publications/show_bibtex_fields.js.erb	Thu May 09 18:47:05 2013 +0100
+++ b/plugins/redmine_bibliography/app/views/publications/show_bibtex_fields.js.erb	Fri May 10 11:50:40 2013 +0100
@@ -6,7 +6,10 @@
     input_id = $this.children('input').attr('id');
     name = input_id.split('_')[4];
 
-    if ($.inArray(name, fields)){
+    if ($.inArray(name, fields) !== -1){
         $this.show();
     }
+    else{
+        $this.hide();
+    }
 });
\ No newline at end of file