Skip to content

Commit

Permalink
Disable video switcher buttons when match play buttons are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
FletcherS7 committed May 21, 2024
1 parent 3f18fdc commit 027a7de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions static/js/match_play.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ const handleArenaStatus = function(data) {
case "PAUSE_PERIOD":
case "TELEOP_PERIOD":
$("#showOverlay").prop("disabled", true);
$("#introRadio").prop("disabled", true);
$("#showFinalScore").prop("disabled", true);
$("#scoreRadio").prop("disabled", true);
$("#startMatch").prop("disabled", true);
$("#abortMatch").prop("disabled", false);
$("#signalReset").prop("disabled", true);
Expand All @@ -208,7 +210,9 @@ const handleArenaStatus = function(data) {
break;
case "POST_MATCH":
$("#showOverlay").prop("disabled", true);
$("#introRadio").prop("disabled", true);
$("#showFinalScore").prop("disabled", true);
$("#scoreRadio").prop("disabled", true);
$("#startMatch").prop("disabled", true);
$("#abortMatch").prop("disabled", true);
$("#signalReset").prop("disabled", false);
Expand All @@ -220,7 +224,9 @@ const handleArenaStatus = function(data) {
break;
case "TIMEOUT_ACTIVE":
$("#showOverlay").prop("disabled", true);
$("#introRadio").prop("disabled", true);
$("#showFinalScore").prop("disabled", true);
$("#scoreRadio").prop("disabled", true);
$("#startMatch").prop("disabled", true);
$("#abortMatch").prop("disabled", false);
$("#signalReset").prop("disabled", true);
Expand All @@ -232,7 +238,9 @@ const handleArenaStatus = function(data) {
break;
case "POST_TIMEOUT":
$("#showOverlay").prop("disabled", true);
$("#introRadio").prop("disabled", true);
$("#showFinalScore").prop("disabled", true);
$("#scoreRadio").prop("disabled", true);
$("#startMatch").prop("disabled", true);
$("#abortMatch").prop("disabled", true);
$("#signalReset").prop("disabled", true);
Expand Down Expand Up @@ -278,6 +286,7 @@ const handleMatchLoad = function(data) {

$("#substituteTeams").prop("disabled", true);
$("#showOverlay").prop("disabled", false);
$("#introRadio").prop("disabled", false);
}

// Handles a websocket message to update the match time countdown.
Expand All @@ -299,6 +308,7 @@ const handleScorePosted = function(data) {
let matchName = data.Match.LongName;
if (matchName) {
$("#showFinalScore").prop("disabled", false);
$("#scoreRadio").prop("disabled", false);
} else {
matchName = "None"
}
Expand Down
6 changes: 4 additions & 2 deletions templates/match_play.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ <h6>Audience Display</h6>
</div>
<div>
<label>
<input type="radio" name="audienceDisplay" value="intro" onclick="setAudienceDisplay();"> Match Intro
<input type="radio" name="audienceDisplay" value="intro"
onclick="setAudienceDisplay();" id="introRadio"> Match Intro
</label>
</div>
<div>
Expand All @@ -123,7 +124,8 @@ <h6>Audience Display</h6>
</div>
<div>
<label>
<input type="radio" name="audienceDisplay" value="score" onclick="setAudienceDisplay();"> Final Score
<input type="radio" name="audienceDisplay" value="score"
onclick="setAudienceDisplay();" id="scoreRadio"> Final Score
</label>
</div>
<div>
Expand Down

0 comments on commit 027a7de

Please sign in to comment.