Revision 1288:7e89ba7fac48 plugins/redmine_bibliography/assets/javascripts
| plugins/redmine_bibliography/assets/javascripts/authors.js | ||
|---|---|---|
| 20 | 20 |
$this.autocomplete({
|
| 21 | 21 |
source: '/publications/autocomplete_for_author', |
| 22 | 22 |
minLength: 2, |
| 23 |
focus: function(event, ui) {
|
|
| 24 |
$this.closest('div').next().find("input[id$='name_on_paper']").val(ui.item.value);
|
|
| 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);
|
|
| 29 |
|
|
| 30 |
return false; |
|
| 31 |
}, |
|
| 23 | 32 |
select: function(event, ui){
|
| 24 | 33 |
$this.closest('div').next().find("input[id$='name_on_paper']").val(ui.item.value);
|
| 25 | 34 |
$this.closest('div').next().find("input[id$='institution']").val(ui.item.institution);
|
| ... | ... | |
| 27 | 36 |
$this.closest('div').next().find("input[id$='search_author_class']").val(ui.item.search_author_class);
|
| 28 | 37 |
$this.closest('div').next().find("input[id$='search_author_id']").val(ui.item.search_author_id);
|
| 29 | 38 |
} |
| 30 |
}); |
|
| 31 |
}); |
|
| 39 |
}) |
|
| 40 |
.data( "autocomplete" )._renderItem = function( ul, item ) {
|
|
| 41 |
return $( "<li></li>" ) |
|
| 42 |
.data( "item.autocomplete", item ) |
|
| 43 |
.append( "<a>" + item.institution + "</a>" ) |
|
| 44 |
.appendTo( ul ); |
|
| 45 |
}; |
|
| 46 |
}); |
|
| 32 | 47 |
|
| 33 | 48 |
|
| 34 | 49 |
|
Also available in: Unified diff