mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-26 13:59:50 -04:00
ui: Don't show filters when there is only one item
This commit is contained in:
parent
557d704a1b
commit
ac52aea6c8
@ -208,9 +208,13 @@ class TimeseriesGraph extends HTMLElement {
|
|||||||
// We need to maintain a stable order for these
|
// We need to maintain a stable order for these
|
||||||
var children = [];
|
var children = [];
|
||||||
for (var key of Object.keys(this.#filterLabels).sort()) {
|
for (var key of Object.keys(this.#filterLabels).sort()) {
|
||||||
|
// If there are multiple items to filter by then show the selectElement.
|
||||||
|
// otherwise there is no point.
|
||||||
|
if (this.#filterLabels[key].length > 1) {
|
||||||
const element = this.#filterSelectElements[key] || this.buildSelectElement(key);
|
const element = this.#filterSelectElements[key] || this.buildSelectElement(key);
|
||||||
children.push(element);
|
children.push(element);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.#menuContainer.replaceChildren(...children);
|
this.#menuContainer.replaceChildren(...children);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user