1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00
This commit is contained in:
Lukas Winkler 2020-07-22 16:12:46 +02:00
parent f407dc4183
commit 8336b74685
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -1,11 +1,12 @@
$(function () {
$('[data-toggle="tooltip"]').tooltip()
document.addEventListener('DOMContentLoaded', function () {
const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-toggle="tooltip"]'))
const tooltipList = tooltipTriggerList.map(
tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl)
)
new Autocomplete('#autocomplete', {
search: input => {
const acroSearch = input.split(':')[0];
const url = "/api/acronym/?search=" + acroSearch
@ -24,10 +25,7 @@ $(function () {
getResultValue: result => (result.name + ": " + result.full_name),
// Open the selected article in
// a new window
onSubmit: result => {
console.log(result)
window.location = "/acronym/" + result.slug
},
autoSelect: true,