Replace goto-grid button with clickable grid cell label in component detail
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -443,14 +443,14 @@ function build_detail_inv_entry(entry) {
|
||||
type_el.className = `type-pill type-${entry.location_type}`;
|
||||
type_el.textContent = LOCATION_TYPE_LABEL[entry.location_type] ?? entry.location_type;
|
||||
|
||||
set_text(el, '.detail-inv-ref', entry.location_type === 'grid' ? grid_cell_label(entry) : (entry.location_ref || '—'));
|
||||
set_text(el, '.detail-inv-qty', entry.quantity ? `×${entry.quantity}` : '');
|
||||
set_text(el, '.detail-inv-notes', entry.notes || '');
|
||||
|
||||
if (entry.location_type === 'grid' && entry.grid_id) {
|
||||
const goto_btn = qs(el, '.detail-inv-goto-grid');
|
||||
goto_btn.hidden = false;
|
||||
goto_btn.addEventListener('click', () => navigate(`/grids/viewer/${entry.grid_id}`));
|
||||
const ref_el = qs(el, '.detail-inv-ref');
|
||||
ref_el.textContent = grid_cell_label(entry);
|
||||
ref_el.classList.add('detail-inv-ref-link');
|
||||
ref_el.addEventListener('click', () => navigate(`/grids/viewer/${entry.grid_id}`));
|
||||
|
||||
// Show the grid cell image as a read-only thumbnail
|
||||
const grid = all_grids.find(g => g.id === entry.grid_id);
|
||||
|
||||
@@ -643,6 +643,15 @@ nav {
|
||||
.type-pill.type-bom { background: var(--badge-bom-bg); color: var(--badge-bom-text); }
|
||||
.type-pill.type-digital { background: var(--badge-digital-bg); color: var(--badge-digital-text); }
|
||||
|
||||
.detail-inv-ref-link {
|
||||
cursor: pointer;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.detail-inv-ref-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.inv-component-link {
|
||||
cursor: pointer;
|
||||
color: var(--accent);
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
<span class="detail-inv-qty"></span>
|
||||
<span class="detail-inv-notes"></span>
|
||||
<span class="row-actions">
|
||||
<button class="btn-icon btn-goto-grid detail-inv-goto-grid" title="View in grid" hidden>⊞</button>
|
||||
<button class="btn-icon btn-edit" title="Edit">✎</button>
|
||||
<button class="btn-icon btn-danger btn-delete" title="Delete">✕</button>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user