From bda21baed2797fcacfa188e842afb35d5ee9211d Mon Sep 17 00:00:00 2001 From: Christophe Vilayphiou Date: Mon, 30 Apr 2012 08:32:54 +0800 Subject: [PATCH] Add missing js --- app/assets/javascripts/news_bulletin_form.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/assets/javascripts/news_bulletin_form.js diff --git a/app/assets/javascripts/news_bulletin_form.js b/app/assets/javascripts/news_bulletin_form.js new file mode 100644 index 000000000..6f0f9ac56 --- /dev/null +++ b/app/assets/javascripts/news_bulletin_form.js @@ -0,0 +1,19 @@ +$('.news_bulletin_links_block a.delete').live('click', function(){ + $(this).parents('.list_item').remove(); +}); + +$('.news_bulletin_files_block a.delete').live('click', function(){ + $(this).parents('.list_item').remove(); +}); + +$(document).on('click', '.action a.remove_existing_record', function(){ + $(this).next('.should_destroy').attr('value', 1); + $("tr #" + $(this).prev().attr('value')).hide(); +}); + +$(document).on('click', '.quick_edit_cancel', function(){ + tr = $(this).attr('rel'); + $('#' + tr).hide(); + $("tr#news_bulletin_file_" + $(this).prev().attr('value')).hide(); + $("tr#news_bulletin_link_" + $(this).prev().attr('value')).hide(); +}); \ No newline at end of file