mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2012 from SchrodingersGat/search-preview-click
Wrap search preview results in <a>
This commit is contained in:
commit
7f75c610ef
@ -111,9 +111,17 @@ function inventreeDocReady() {
|
|||||||
},
|
},
|
||||||
create: function () {
|
create: function () {
|
||||||
$(this).data('ui-autocomplete')._renderItem = function (ul, item) {
|
$(this).data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||||
return $('<li>')
|
|
||||||
.append('<span>' + imageHoverIcon(item.thumbnail) + item.label + '</span>')
|
var html = `<a href='/part/${item.id}/'><span>`;
|
||||||
.appendTo(ul);
|
|
||||||
|
html += `<img class='hover-img-thumb' src='`;
|
||||||
|
html += item.thumbnail || `/static/img/blank_image.png`;
|
||||||
|
html += `'> `;
|
||||||
|
html += item.label;
|
||||||
|
|
||||||
|
html += '</span></a>';
|
||||||
|
|
||||||
|
return $('<li>').append(html).appendTo(ul);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
select: function( event, ui ) {
|
select: function( event, ui ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user