mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Wrap search preview results in <a>
- Allows clicking with middle mouse (for e.g.) to open in new tab
This commit is contained in:
		@@ -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 ) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user