[client/device graph] Style buttons

pull/26/head
Starbeamrainbowlabs 4 years ago
parent 01404172b5
commit 051690c9e1
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 10
      client_src/css/main.css
  2. 7
      client_src/js/DeviceReadingDisplay.mjs

@ -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;
}

@ -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);
}

Loading…
Cancel
Save