refactoring

This commit is contained in:
Devaev Maxim 2019-11-08 01:34:30 +03:00
parent b261c2695c
commit 3c1681fd2b
2 changed files with 2 additions and 10 deletions

View File

@ -45,11 +45,7 @@ export function Atx() {
self.setState = function(state) {
if (state) {
if (state.enabled) {
$("atx-dropdown").classList.remove("feature-disabled");
} else {
$("atx-dropdown").classList.add("feature-disabled");
}
$("atx-dropdown").classList.toggle("feature-disabled", !state.enabled);
}
$("atx-power-led").className = ((state && state.leds.power) ? "led-green" : "led-gray");

View File

@ -64,11 +64,7 @@ export function Mouse() {
self.setSocket = function(ws) {
__ws = ws;
if (ws) {
$("stream-box").classList.add("stream-box-mouse-enabled");
} else {
$("stream-box").classList.remove("stream-box-mouse-enabled");
}
$("stream-box").classList.toggle("stream-box-mouse-enabled", ws);
__updateLeds();
};