Fix eslint offenses
This commit is contained in:
@@ -36,13 +36,14 @@ function onConnect() {
|
||||
// data update and parse functions
|
||||
function parseCups(ev){
|
||||
var cups = parseFloat(ev.detail).toFixed(1)
|
||||
if (String(cups) !== '-1.0') {
|
||||
var cupsEvent = new CustomEvent("cupsChanged", {'detail': cups});
|
||||
window.dispatchEvent(cupsEvent);
|
||||
} else {
|
||||
var cupsEvent = new CustomEvent("cupsError", {'detail': 'Error: unable to fetch cups :('});
|
||||
window.dispatchEvent(cupsEvent);
|
||||
|
||||
function makeEvent(cups) {
|
||||
return (String(cups) !== '-1.0')
|
||||
? new CustomEvent("cupsChanged", {'detail': cups})
|
||||
: new CustomEvent("cupsError", {'detail': 'Error: unable to fetch cups :('});
|
||||
}
|
||||
|
||||
window.dispatchEvent(makeEvent(cups));
|
||||
}
|
||||
function updateCups(ev){
|
||||
$("#text").text(ev.detail);
|
||||
|
||||
Reference in New Issue
Block a user