From 6db923237bac2c827a11c90082445ed8d65ff778 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 12 Mar 2015 18:20:54 +0800 Subject: [PATCH] small fix for js --- app/assets/javascripts/personal_journal/author.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/personal_journal/author.js.erb b/app/assets/javascripts/personal_journal/author.js.erb index 66289d2..c53e18f 100644 --- a/app/assets/javascripts/personal_journal/author.js.erb +++ b/app/assets/javascripts/personal_journal/author.js.erb @@ -6,7 +6,7 @@ var on = $('.language-nav li.active').index(); var le = $(this).parent('.add-btn-box').prev('.add-target-box').children('.start-line').length; $(this).prev().attr('value', parseInt(new_id) + 1); - $(this).parent().siblings('.add-target-box').append(("<%= escape_javascript(add_attribute 'form_author', f, :journal_paper_authors) %>").replace(old_id, new_id)); + $(this).parent().siblings('.add-target-box').append(("<%= escape_javascript(add_attribute 'form_author', (f rescue nil), :journal_paper_authors) %>").replace(old_id, new_id)); $(this).parent('.add-btn-box').prev('.add-target-box').children('.start-line').eq(le).children('.input-append').find('.tab-content').each(function() { $(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active'); });