Merge pull request #2473 from betagouv/dev

MEP 2018-08-28-02
This commit is contained in:
Mathieu Magnin 2018-08-28 14:08:10 +02:00 committed by GitHub
commit dfb734cfcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 6 deletions

View file

@ -38,10 +38,12 @@ function source(url) {
addEventListener('turbolinks:load', function() { addEventListener('turbolinks:load', function() {
for (let { type, url } of sources) { for (let { type, url } of sources) {
let select = autocomplete(selector(type), options, [source(url)]); for (let target of document.querySelectorAll(selector(type))) {
select.on('autocomplete:selected', ({ target }, suggestion) => { let select = autocomplete(target, options, [source(url)]);
$(target).trigger('autocomplete:select', suggestion); select.on('autocomplete:selected', ({ target }, suggestion) => {
select.autocomplete.setVal(suggestion.label); $(target).trigger('autocomplete:select', suggestion);
}); select.autocomplete.setVal(suggestion.label);
});
}
} }
}); });

View file

@ -6,5 +6,5 @@
transfer_errors_message(false); transfer_errors_message(false);
$("#email_admin").val(''); $("#email_admin").val('');
$("#transferModal button#cancel").click(); $('[role=dialog]').modal('hide');
<%- end %> <%- end %>