Skip to content

Commit

Permalink
Switch standalone bracket display to highlight current match without …
Browse files Browse the repository at this point in the history
…connectors, rather than saved match with connectors.
  • Loading branch information
patfair committed Sep 30, 2022
1 parent 72669df commit 265707c
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 158 deletions.
2 changes: 1 addition & 1 deletion static/js/audience_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ var handleScorePosted = function(data) {
$("#finalMatchName").text(data.MatchType + " " + data.Match.DisplayName);

// Reload the bracket to reflect any changes.
$("#bracketSvg").attr("src", "/api/bracket/svg?v=" + new Date().getTime());
$("#bracketSvg").attr("src", "/api/bracket/svg?activeMatch=saved&v=" + new Date().getTime());

if (data.Match.Type === "elimination") {
// Hide bonus ranking points.
Expand Down
8 changes: 4 additions & 4 deletions static/js/bracket_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

var websocket;

// Handles a websocket message to populate the final score data, which also triggers a bracket update.
const handleScorePosted = function(data) {
$("#bracketSvg").attr("src", "/api/bracket/svg?v=" + new Date().getTime());
// Handles a websocket message to load a new match.
const handleMatchLoad = function(data) {
$("#bracketSvg").attr("src", "/api/bracket/svg?activeMatch=current&v=" + new Date().getTime());
};

$(function() {
// Set up the websocket back to the server.
websocket = new CheesyWebsocket("/displays/bracket/websocket", {
scorePosted: function(event) { handleScorePosted(event.data); },
matchLoad: function(event) { handleMatchLoad(event.data); },
});
});
Loading

0 comments on commit 265707c

Please sign in to comment.