Add manufacturer to Log Material item combobox
Shows manufacturer name as muted secondary text in each dropdown row and includes it in the search filter, so users can find a powder by brand when multiple items share a similar name. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
if (!dd) return;
|
||||
const filtered = query
|
||||
? _items.filter(it => it.name.toLowerCase().includes(query) ||
|
||||
(it.manufacturer && it.manufacturer.toLowerCase().includes(query)) ||
|
||||
(it.unitOfMeasure && it.unitOfMeasure.toLowerCase().includes(query)))
|
||||
: _items;
|
||||
if (filtered.length === 0) {
|
||||
@@ -48,6 +49,7 @@
|
||||
}
|
||||
dd.innerHTML = filtered.map(it => {
|
||||
const label = it.name + (it.unitOfMeasure ? ' (' + it.unitOfMeasure + ')' : '');
|
||||
const mfr = it.manufacturer ? `<span class="text-muted ms-1" style="font-size:.78rem;">${escLm(it.manufacturer)}</span>` : '';
|
||||
return `<div class="lm-item-opt" style="padding:.35rem .75rem;font-size:.875rem;cursor:pointer;"
|
||||
data-id="${it.id}"
|
||||
data-qty="${it.quantityOnHand}"
|
||||
@@ -56,7 +58,7 @@
|
||||
onmousedown="event.preventDefault(); lmComboSelect(this)"
|
||||
onmouseenter="this.style.background='#f0f4ff'"
|
||||
onmouseleave="this.classList.contains('lm-active') ? null : this.style.background=''">
|
||||
${escLm(label)}
|
||||
${escLm(label)}${mfr}
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user