Skip to content

Commit

Permalink
Hide irrelevant tabs before joining. Fixes #175
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffkaufman committed Feb 11, 2021
1 parent 5b0ead6 commit ef84501
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions html/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ function set_controls() {

window.middle.style.overflowY = app_state == APP_RUNNING ? "hidden" : "scroll";

setVisibleIn(window.advancedSettingsTab, [APP_RUNNING], 'inline-block');
setVisibleIn(window.debugTab, [APP_RUNNING], 'inline-block');

setVisibleIn(window.mainApp, allStatesExcept([APP_RUNNING]));
setVisibleIn(window.topbar, allStatesExcept([APP_RUNNING]));
setVisibleIn(window.tabbarLogo, [APP_RUNNING]);
Expand Down
20 changes: 13 additions & 7 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@
background-color: var(--theme-light);
}

#advancedSettingsTab, #debugTab {
display: none;
}

#controlbar {
display: flex;
background-color: var(--theme-medium);
Expand Down Expand Up @@ -582,12 +586,12 @@ <h1 id=instanceName>Bucket Brigade</h1>
<div id=tabbar>
<img id=tabbarLogo src="https://www.jefftk.com/bucket-brigade-logo.png" width=32 height=32>
<span class=activeTab id=mainViewTab>Home</span>
<span id=advancedSettingsTab>Advanced</span>
<span id=recordingsTab>Recordings</span>
<span id=debugTab>Debug</span>
<span id=booktimeTab>Reserve</span>
<span id=helpTab>Help</span>
<span id=aboutTab>About</span>
<span id=booktimeTab>Reserve</span>
<span id=recordingsTab>Recordings</span>
<span id=advancedSettingsTab>Advanced</span>
<span id=debugTab>Debug</span>
</div>

</div>
Expand Down Expand Up @@ -1273,7 +1277,7 @@ <h2>Then refresh the page and try again.</h2>
"About": window.about,
"Help": window.help,
"Recordings": window.recordings,
"AdvancedSettings": window.advancedSettings,
"Advanced": window.advancedSettings,
"UnsupportedBrowser": window.noAudioWorklet,
"UnsupportedDevice": window.isMobile,
};
Expand All @@ -1284,7 +1288,7 @@ <h2>Then refresh the page and try again.</h2>
"Reserve": window.booktimeTab,
"About": window.aboutTab,
"Help": window.helpTab,
"AdvancedSettings": window.advancedSettingsTab,
"Advanced": window.advancedSettingsTab,
"Recordings": window.recordingsTab,
};

Expand Down Expand Up @@ -1329,8 +1333,10 @@ <h2>Then refresh the page and try again.</h2>

if (window.location.hash && !showingWarningPane) {
const paneName = window.location.hash.substring(1);
if (paneName in tabs) {
if (paneName in tabs && paneName != "Debug" && paneName != "Advanced") {
showPane(paneName);
} else {
window.location.hash = "";
}
}
</script>
Expand Down

0 comments on commit ef84501

Please sign in to comment.