feat: expand firmware sections on search
This commit is contained in:
@@ -154,8 +154,10 @@ class FirmwareComponent extends Component {
|
||||
`;
|
||||
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 = `
|
||||
<div class="firmware-groups">
|
||||
@@ -167,11 +169,14 @@ class FirmwareComponent extends Component {
|
||||
this.setupFirmwareItemListeners();
|
||||
}
|
||||
|
||||
renderFirmwareGroup(group) {
|
||||
renderFirmwareGroup(group, autoExpand = false) {
|
||||
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 `
|
||||
<div class="firmware-group">
|
||||
<div class="firmware-group ${expandedClass}">
|
||||
<div class="firmware-group-header">
|
||||
<div class="firmware-group-header-content">
|
||||
<h3 class="firmware-group-name">${this.escapeHtml(group.name)}</h3>
|
||||
|
||||
Reference in New Issue
Block a user