Skip to content

Commit 2eaa0e7

Browse files
committed
Add Status tooltip
1 parent 2716d08 commit 2eaa0e7

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

dist/brackets-viewer.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
"webpack-cli": "^3.3.11"
4444
},
4545
"dependencies": {
46-
"brackets-model": "^1.1.0"
46+
"brackets-model": "^1.2.0"
4747
}
4848
}

src/dom.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export function createMatchContainer() {
2525
return match;
2626
}
2727

28-
export function createMatchLabel(label: string) {
28+
export function createMatchLabel(label: string, status: string) {
2929
const span = document.createElement('span');
3030
span.innerText = label;
31+
span.title = status;
3132
return span;
3233
}
3334

src/lang.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Match } from "brackets-model";
1+
import { Match, Status } from "brackets-model";
22
import { isMajorRound } from "./helpers";
33

44
export function getMatchHint(roundNumber: number, roundCount: number, inLowerBracket?: boolean): MatchHint {
@@ -58,6 +58,17 @@ export function getFinalMatchHint(type: string, i: number): MatchHint {
5858
return undefined;
5959
}
6060

61+
export function getMatchStatus(status: Status) {
62+
switch (status) {
63+
case Status.Locked: return 'Locked';
64+
case Status.Waiting: return 'Waiting';
65+
case Status.Ready: return 'Ready';
66+
case Status.Running: return 'Running';
67+
case Status.Completed: return 'Completed';
68+
case Status.Archived: return 'Archived';
69+
}
70+
}
71+
6172
export function getGrandFinalName(matches: Match[]) {
6273
return matches.length === 1 ? () => 'Grand Final' : (i: number) => `GF Round ${i + 1}`;
6374
}

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class BracketsViewer {
187187
const team2 = this.createTeam(results.opponent2, hint, inLowerBracket);
188188

189189
if (label)
190-
teams.append(dom.createMatchLabel(label));
190+
teams.append(dom.createMatchLabel(label, lang.getMatchStatus(results.status)));
191191

192192
teams.append(team1, team2);
193193
match.append(teams);

0 commit comments

Comments
 (0)