| 10 |
10 |
$(link).closest(".fields").hide();
|
| 11 |
11 |
}
|
| 12 |
12 |
|
| 13 |
|
$(".author_search").live('keyup.autocomplete', function(){
|
|
13 |
$(".author_name_on_paper").live('keyup.autocomplete', function(){
|
| 14 |
14 |
$this = $(this);
|
| 15 |
15 |
|
| 16 |
16 |
$this.autocomplete({
|
| ... | ... | |
| 21 |
21 |
return false;
|
| 22 |
22 |
},
|
| 23 |
23 |
select: function(event, ui){
|
| 24 |
|
$this.closest('div').next().find("input[id$='name_on_paper']").val(ui.item.name);
|
| 25 |
|
$this.closest('div').next().find("input[id$='institution']").val(ui.item.institution);
|
| 26 |
|
$this.closest('div').next().find("input[id$='email']").val(ui.item.email);
|
| 27 |
|
$this.closest('div').next().find("input[id$='search_author_class']").val(ui.item.search_author_class);
|
| 28 |
|
$this.closest('div').next().find("input[id$='search_author_id']").val(ui.item.search_author_id);
|
|
24 |
$this.closest('div').find("input[id$='institution']").val(ui.item.institution);
|
|
25 |
$this.closest('div').find("input[id$='email']").val(ui.item.email);
|
|
26 |
|
|
27 |
$this.closest('div').find("input[id$='search_author_class']").val(ui.item.search_author_class);
|
|
28 |
$this.closest('div').find("input[id$='search_author_id']").val(ui.item.search_author_id);
|
|
29 |
$this.closest('div').find("input[id$='search_author_tie']").attr('checked', 'checked');
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
// triggers the save button
|
|
34 |
$this.closest('div').next('div').find('.author_save_btn').click();
|
| 29 |
35 |
}
|
| 30 |
36 |
})
|
| 31 |
37 |
.data( "autocomplete" )._renderItem = function( ul, item ) {
|
| ... | ... | |
| 36 |
42 |
};
|
| 37 |
43 |
});
|
| 38 |
44 |
|
| 39 |
|
|
| 40 |
|
$("input[id$='identify_author_yes']").live("click", function() {
|
| 41 |
|
console.log("aaaa");
|
| 42 |
|
});
|
| 43 |
|
|
| 44 |
|
$("input[id$='identify_author_no']").live("click", function() {
|
| 45 |
|
$this.closest('div').next().find("input[id$='name_on_paper']").val('');
|
| 46 |
|
$this.closest('div').next().find("input[id$='institution']").val('');
|
| 47 |
|
$this.closest('div').next().find("input[id$='email']").val('');
|
| 48 |
|
$this.closest('div').next().find("input[id$='search_author_class']").val('');
|
| 49 |
|
});
|
| 50 |
|
|