From 9cfcb6579fe573223512986368e06f1a47b9a5ff Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 4 Nov 2021 16:48:24 +1100 Subject: [PATCH] Fixes for search auto-complete dropdown menu - Fix rendering of badges - Menu fills out right-to-left --- .../static/script/inventree/inventree.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/InvenTree/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js index 5d393a085a..5974e12fc5 100644 --- a/InvenTree/InvenTree/static/script/inventree/inventree.js +++ b/InvenTree/InvenTree/static/script/inventree/inventree.js @@ -158,14 +158,13 @@ function inventreeDocReady() { create: function() { $(this).data('ui-autocomplete')._renderItem = function(ul, item) { - var html = ``; - - html += ` `; - html += item.label; - - html += ''; + var html = ` +
+ + ${item.label} + + + `; if (user_settings.SEARCH_SHOW_STOCK_LEVELS) { html += partStockLabel( @@ -176,7 +175,7 @@ function inventreeDocReady() { ); } - html += ''; + html += '
'; return $('
  • ').append(html).appendTo(ul); }; @@ -188,6 +187,10 @@ function inventreeDocReady() { classes: { 'ui-autocomplete': 'dropdown-menu search-menu', }, + position: { + my : "right top", + at: "right bottom" + } }); }