Revision 1392:d262df85ac97 plugins/redmine_bibliography/assets/javascripts

View differences:

plugins/redmine_bibliography/assets/javascripts/authors.js
3 3
    var regexp = new RegExp("new_" + association, "g");
4 4

  
5 5
    $(link).before(content.replace(regexp, new_id));
6

  
7
    if(action != "new"){
8
        toggle_save_author(new_id, $(link));
9
    }
10 6
}
11 7

  
12 8
function remove_fields(link) {
......
57 53
    $this.closest('div').next().find("input[id$='search_author_class']").val('');
58 54
});
59 55

  
60
function toggle_div(div_id){
61
    $("#" + div_id).toggle(0.3);
62
}
63

  
64
function toggle_save_author(form_object_id, $this){
65
    $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('input').each(function(s) {
66
	toggle_input_field(s, $this);
67
    });
68
    $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('p.description').each(function(s) {
69
	s.toggle();
70
    });
71
    toggle_edit_save_button(form_object_id);
72
    toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author");
73
}

Also available in: Unified diff