feat: expand firmware sections on search
This commit is contained in:
@@ -154,8 +154,10 @@ class FirmwareComponent extends Component {
|
|||||||
`;
|
`;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const firmwareHTML = filteredGroups.map(group => this.renderFirmwareGroup(group)).join('');
|
// Auto-expand groups when search is active to show results
|
||||||
|
const autoExpand = searchQuery.trim().length > 0;
|
||||||
|
const firmwareHTML = filteredGroups.map(group => this.renderFirmwareGroup(group, autoExpand)).join('');
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div class="firmware-groups">
|
<div class="firmware-groups">
|
||||||
@@ -167,11 +169,14 @@ class FirmwareComponent extends Component {
|
|||||||
this.setupFirmwareItemListeners();
|
this.setupFirmwareItemListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderFirmwareGroup(group) {
|
renderFirmwareGroup(group, autoExpand = false) {
|
||||||
const versionsHTML = group.firmware.map(firmware => this.renderFirmwareVersion(firmware)).join('');
|
const versionsHTML = group.firmware.map(firmware => this.renderFirmwareVersion(firmware)).join('');
|
||||||
|
|
||||||
|
// Add 'expanded' class if autoExpand is true (e.g., when search results are shown)
|
||||||
|
const expandedClass = autoExpand ? 'expanded' : '';
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<div class="firmware-group">
|
<div class="firmware-group ${expandedClass}">
|
||||||
<div class="firmware-group-header">
|
<div class="firmware-group-header">
|
||||||
<div class="firmware-group-header-content">
|
<div class="firmware-group-header-content">
|
||||||
<h3 class="firmware-group-name">${this.escapeHtml(group.name)}</h3>
|
<h3 class="firmware-group-name">${this.escapeHtml(group.name)}</h3>
|
||||||
|
|||||||
Reference in New Issue
Block a user