commit
dfb734cfcf
2 changed files with 8 additions and 6 deletions
|
@ -38,10 +38,12 @@ function source(url) {
|
|||
|
||||
addEventListener('turbolinks:load', function() {
|
||||
for (let { type, url } of sources) {
|
||||
let select = autocomplete(selector(type), options, [source(url)]);
|
||||
select.on('autocomplete:selected', ({ target }, suggestion) => {
|
||||
$(target).trigger('autocomplete:select', suggestion);
|
||||
select.autocomplete.setVal(suggestion.label);
|
||||
});
|
||||
for (let target of document.querySelectorAll(selector(type))) {
|
||||
let select = autocomplete(target, options, [source(url)]);
|
||||
select.on('autocomplete:selected', ({ target }, suggestion) => {
|
||||
$(target).trigger('autocomplete:select', suggestion);
|
||||
select.autocomplete.setVal(suggestion.label);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
transfer_errors_message(false);
|
||||
$("#email_admin").val('');
|
||||
|
||||
$("#transferModal button#cancel").click();
|
||||
$('[role=dialog]').modal('hide');
|
||||
<%- end %>
|
||||
|
|
Loading…
Reference in a new issue