separate data and css

This commit is contained in:
Matt Walsh
2020-09-08 10:05:46 -05:00
parent 180ac0c5fa
commit 4cf146c7a2
19 changed files with 59 additions and 109 deletions

View File

@@ -176,7 +176,7 @@ const navigation = (() => {
},
};
// receive naivgation messages from displays
// receive navigation messages from displays
const displayNavMessage = (message) => {
if (message.type === msg.response.previous) loadDisplay(-1);
if (message.type === msg.response.next) loadDisplay(1);
@@ -208,8 +208,9 @@ const navigation = (() => {
// get the current display index or value
const currentDisplayIndex = () => {
const index = displays.findIndex(display=>display.isActive());
if (index === undefined) console.error('No active display');
let index = displays.findIndex(display=>display.isActive());
// if there is no active display, default to the first one
if (index === -1) index = displays.length-1;
return index;
};
const currentDisplay = () => {