adding style and picture

This commit is contained in:
Matthias 2021-07-20 18:51:27 +02:00
parent d0e425ad30
commit 30f94bef41
2 changed files with 21 additions and 5 deletions

View File

@ -1037,3 +1037,10 @@ a.anchor {
height: 30px;
}
.search-menu {
padding-top: 2rem;
}
.search-menu .ui-menu-item {
margin-top: 0.5rem;
}

View File

@ -91,7 +91,8 @@ function inventreeDocReady() {
var transformed = $.map(data.results, function (el) {
return {
label: el.name,
id: el.pk
id: el.pk,
thumbnail: el.thumbnail
};
});
response(transformed);
@ -101,11 +102,19 @@ function inventreeDocReady() {
}
});
},
minLength: 2,
classes: {'ui-autocomplete': 'dropdown-menu'},
create: function () {
$(this).data('ui-autocomplete')._renderItem = function (ul, item) {
console.log(item);
return $('<li>')
.append('<span>' + imageHoverIcon(item.thumbnail) + item.label + '</span>')
.appendTo(ul);
};
},
select: function( event, ui ) {
window.location = '/part/' + ui.item.id + '/';
}
window.location = '/part/' + ui.item.id + '/';
},
minLength: 2,
classes: {'ui-autocomplete': 'dropdown-menu search-menu'},
});
}