mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-30 06:39:40 +02:00
Added a simple autocomplete mechanism for the footprint URL.
This commit is contained in:
parent
4675793c24
commit
3277d98ee2
10 changed files with 180 additions and 6 deletions
|
@ -347,6 +347,31 @@ $(document).on("ajaxUI:start", function() {
|
|||
|
||||
});
|
||||
|
||||
//Register typeaheads
|
||||
$(document).on("ajaxUI:reload ajaxUI:start", function () {
|
||||
$('input[data-autocomplete]').each(function() {
|
||||
//@ts-ignore
|
||||
var engine = new Bloodhound({
|
||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace(''),
|
||||
queryTokenizer: Bloodhound.tokenizers.obj.whitespace(''),
|
||||
remote: {
|
||||
url: $(this).data('autocomplete'),
|
||||
wildcard: 'QUERY'
|
||||
}
|
||||
});
|
||||
|
||||
$(this).typeahead({
|
||||
hint: true,
|
||||
highlight: true,
|
||||
minLength: 1
|
||||
},
|
||||
{
|
||||
name: 'states',
|
||||
source: engine
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
//Need for proper body padding, with every navbar height
|
||||
$(window).resize(function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue