Revision 1383:f019ad7fcf1b plugins/redmine_bibliography/assets

View differences:

plugins/redmine_bibliography/assets/javascripts/bibliography.js
1
// bibliography.js
1 2

  
2
$("#publication_bibtex_entry_attributes_entry_type").live("change", function() {
3
    $this = $(this);
3
function disable_fields(){
4
	$this = $(this);
5
	$author_info = $this.closest('div').prev();
6
	$author_info.children('.description').toggle();
7
	$author_info.find('p :input').attr("readonly", true);
8
    $author_info.find('p :input').addClass('readonly');
4 9

  
5
    $.ajax({
6
        type: "get",
7
        url: "/publications/show_bibtex_fields",
8
        data: {
9
            value: $this.val()
10
        },
11
        dataType: "script"
12
    });
10
    $this.siblings('.author_edit_btn').show();
11
    $this.hide();
13 12

  
14 13
    return false;
15
});
16
$(document).ready(function() {
17
    $("#publication_bibtex_entry_attributes_entry_type").trigger('change');
18
});
14
}
15

  
16
function enable_fields(){
17
    $this = $(this);
18
    $author_info = $this.closest('div').prev();
19
    $author_info.children('.description').toggle();
20
    $author_info.find('p :input').attr("readonly", false);
21
    $author_info.find('p :input').removeClass('readonly');
22

  
23
    $this.siblings('.author_save_btn').show();
24
    $this.hide();
25

  
26
    return false;
27
}
plugins/redmine_bibliography/assets/stylesheets/bibliography.css
4 4
    color: #777;
5 5
}
6 6

  
7
input.readonly {
7
.readonly {
8 8
    border: none;
9 9
    padding: 0;
10 10
    margin: 0;
......
71 71
  background-image: url(../../../images/loading.gif);
72 72
}
73 73

  
74
.author_edit_btn {
75
  display:none;
76
}
77

  

Also available in: Unified diff