fix js for form
This commit is contained in:
parent
5215d76382
commit
4a8a0df7da
|
@ -303,9 +303,8 @@
|
|||
<%= link_to t('cancel'), get_go_back, :class=>"btn" %>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.main-forms .add-on').tooltip();
|
||||
$(document).on('click', '#add_file', function(){
|
||||
$('.main-forms').find('.add-on').tooltip().end().on('click', '.trigger, .delete_file, .remove_existing_record', function() {
|
||||
if($(this).hasClass('trigger')) {
|
||||
var new_id = $(this).prev().attr('value');
|
||||
var old_id = new RegExp("new_journal_paper_files", "g");
|
||||
var on = $('.language-nav li.active').index();
|
||||
|
@ -316,15 +315,13 @@
|
|||
$(this).children('.tab-pane').eq(on).addClass('in active').siblings().removeClass('in active');
|
||||
});
|
||||
formTip();
|
||||
});
|
||||
$(document).on('click', '.delete_file', function(){
|
||||
} else if($(this).hasClass('delete_file')) {
|
||||
$(this).parents('.input-prepend').remove();
|
||||
});
|
||||
$(document).on('click', '.remove_existing_record', function(){
|
||||
} else if($(this).hasClass('remove_existing_record')) {
|
||||
if(confirm("<%= I18n.t(:sure?)%>")){
|
||||
$(this).children('.should_destroy').attr('value', 1);
|
||||
$(this).parents('.start-line').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Reference in New Issue