mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-23 04:29:48 -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
|
||||
var children = [];
|
||||
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);
|
||||
children.push(element);
|
||||
}
|
||||
}
|
||||
this.#menuContainer.replaceChildren(...children);
|
||||
}
|
||||
|
||||
@ -237,7 +241,7 @@ class TimeseriesGraph extends HTMLElement {
|
||||
return function() {
|
||||
var name = "yaxis";
|
||||
if (counter != 1) {
|
||||
name = "yaxis" + counter ;
|
||||
name = "yaxis" + counter;
|
||||
}
|
||||
counter++;
|
||||
return name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user