mirror of
https://github.com/zaphar/Heracles.git
synced 2025-07-24 13:09:47 -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +241,7 @@ class TimeseriesGraph extends HTMLElement {
|
|||||||
return function() {
|
return function() {
|
||||||
var name = "yaxis";
|
var name = "yaxis";
|
||||||
if (counter != 1) {
|
if (counter != 1) {
|
||||||
name = "yaxis" + counter ;
|
name = "yaxis" + counter;
|
||||||
}
|
}
|
||||||
counter++;
|
counter++;
|
||||||
return name;
|
return name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user