mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-22 06:23:01 +00:00
[client/device graph] Style buttons
This commit is contained in:
parent
01404172b5
commit
051690c9e1
2 changed files with 16 additions and 1 deletions
|
@ -77,3 +77,13 @@ h2.device-name { text-align: center; }
|
||||||
border-left: 0.2em solid hsl(222, 100%, 59%);
|
border-left: 0.2em solid hsl(222, 100%, 59%);
|
||||||
padding-left: 0.5em;
|
padding-left: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reading-types {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button.selected {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
|
@ -35,7 +35,12 @@ class DeviceReadingDisplay {
|
||||||
|
|
||||||
let reading_type_list = this.display.querySelector(".reading-types");
|
let reading_type_list = this.display.querySelector(".reading-types");
|
||||||
for(let reading_type of this.reading_types) {
|
for(let reading_type of this.reading_types) {
|
||||||
let new_element = CreateElement("li", reading_type.friendly_text);
|
let new_element = CreateElement("li",
|
||||||
|
CreateElement("button", reading_type.friendly_text)
|
||||||
|
);
|
||||||
|
if(reading_type.id == this.reading_type.id)
|
||||||
|
new_element.querySelector("button").classList.add("selected");
|
||||||
|
|
||||||
new_element.dataset.id = reading_type.id;
|
new_element.dataset.id = reading_type.id;
|
||||||
reading_type_list.appendChild(new_element);
|
reading_type_list.appendChild(new_element);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue