Compare commits
No commits in common. "7c1465428f2414199c990bd7dd15afeac3ad3711" and "b9d788935d17340b2cd83f32be6aa768657de478" have entirely different histories.
7c1465428f
...
b9d788935d
@ -27,17 +27,6 @@ function initialize_autocompletion_foreign_key_field(search_element) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// select first match if any on enter
|
|
||||||
search_element.addEventListener('keydown', (e) => {
|
|
||||||
if (e.key === "Enter") {
|
|
||||||
e.preventDefault();
|
|
||||||
first_search_result = search_element.parentElement.querySelector('li')
|
|
||||||
if (first_search_result) {
|
|
||||||
first_search_result.click()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
new AutocompleteCustomUi(
|
new AutocompleteCustomUi(
|
||||||
base_id, base_id+'-ac-ul', function(search_query, autocomplete_obj) {
|
base_id, base_id+'-ac-ul', function(search_query, autocomplete_obj) {
|
||||||
api_ajax_request_without_send('GET', search_url+`?search=${encodeURIComponent(search_query)}`, function(method, url, json) {
|
api_ajax_request_without_send('GET', search_url+`?search=${encodeURIComponent(search_query)}`, function(method, url, json) {
|
||||||
|
@ -38,9 +38,7 @@ class AutocompleteCustomUi {
|
|||||||
this.query_callback = query_function.bind(this);
|
this.query_callback = query_function.bind(this);
|
||||||
|
|
||||||
document.getElementById(text_id).addEventListener("keyup", this.ac_delay(function(event) {
|
document.getElementById(text_id).addEventListener("keyup", this.ac_delay(function(event) {
|
||||||
if (event.key != 'Enter') {
|
|
||||||
this.query_callback(document.getElementById(this.text_id).value, this);
|
this.query_callback(document.getElementById(this.text_id).value, this);
|
||||||
}
|
|
||||||
}, autocomplete_query_delay_ms).bind(this));
|
}, autocomplete_query_delay_ms).bind(this));
|
||||||
|
|
||||||
this.dropdown_data = {};
|
this.dropdown_data = {};
|
||||||
|
@ -83,14 +83,6 @@
|
|||||||
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
|
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')
|
||||||
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
|
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
|
||||||
</script>
|
</script>
|
||||||
<!-- Select search field on start of QR scan ([) -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.addEventListener("keydown", (event)=>{
|
|
||||||
if (event.key == '[') {
|
|
||||||
document.getElementById("qr_search_field").focus()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
{% block custom_scripts %}
|
{% block custom_scripts %}
|
||||||
{% endblock custom_scripts %}
|
{% endblock custom_scripts %}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user