This commit is contained in:
Matthias 2021-07-19 01:17:32 +02:00
parent 866c8af393
commit 6ca34276bd
2 changed files with 10 additions and 9 deletions

View File

@ -80,6 +80,16 @@ function inventreeDocReady() {
attachClipboard('.clip-btn');
attachClipboard('.clip-btn', 'modal-about'); // modals
attachClipboard('.clip-btn-version', 'modal-about', 'about-copy-text'); // version-text
// Add autocomplete to the search-bar
$("#search-bar" ).autocomplete({
source: "{% url 'search-api' %}",
minLength: 2,
classes: {'ui-autocomplete': 'dropdown-menu'},
select: function( event, ui ) {
window.location = '/part/' + ui.item.id + '/';
}
});
}
function isFileTransfer(transfer) {

View File

@ -191,15 +191,6 @@ $(document).ready(function () {
{% endif %}
moment.locale('{{request.LANGUAGE_CODE}}');
$("#search-bar" ).autocomplete({
source: "{% url 'search-api' %}",
minLength: 2,
classes: {'ui-autocomplete': 'dropdown-menu'},
select: function( event, ui ) {
window.location = '/part/' + ui.item.id + '/';
}
});
});
</script>