[client/device graph] Style buttons

This commit is contained in:
Starbeamrainbowlabs 2019-01-20 20:53:12 +00:00
parent 01404172b5
commit 051690c9e1
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 16 additions and 1 deletions

View file

@ -77,3 +77,13 @@ h2.device-name { text-align: center; }
border-left: 0.2em solid hsl(222, 100%, 59%);
padding-left: 0.5em;
}
.reading-types {
display: flex;
flex-direction: row;
list-style-type: none;
}
button.selected {
font-weight: bolder;
}

View file

@ -35,7 +35,12 @@ class DeviceReadingDisplay {
let reading_type_list = this.display.querySelector(".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;
reading_type_list.appendChild(new_element);
}