Skip to content

Commit

Permalink
Disable input fields when auto pairing is active
Browse files Browse the repository at this point in the history
  • Loading branch information
gbtami committed Dec 27, 2024
1 parent 8ca39ef commit 5dc528d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions client/lobby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -977,13 +977,19 @@ export class LobbyController implements ChatController {
}

renderAutoPairingActions(autoPairingIsOn: boolean) {
const eRange = document.querySelector('div.auto-rating-range') as Element;
const eTimeControls = document.querySelector('div.timecontrols') as Element;
const eVariants = document.querySelector('div.variants') as Element;
if (autoPairingIsOn) {
this.autoPairingActions = patch(this.autoPairingActions,
h('div.auto-pairing-actions', [
h('span.standingby', _('Standing by for auto pairing...')),
h('button.cancel', { on: { click: () => this.autoPairingCancel() } }, [h('div.icon.icon-ban', _('CANCEL'))]),
])
);
eRange.classList.toggle("disabled", true);
eTimeControls.classList.toggle("disabled", true);
eVariants.classList.toggle("disabled", true);
} else {
this.autoPairingActions = patch(this.autoPairingActions,
h('div.auto-pairing-actions', [
Expand All @@ -992,6 +998,9 @@ export class LobbyController implements ChatController {
h('button.submit', { on: { click: () => this.autoPairingSubmit() } }, [h('div.icon.icon-check', _('SUBMIT'))]),
])
);
eRange.classList.toggle("disabled", false);
eTimeControls.classList.toggle("disabled", false);
eVariants.classList.toggle("disabled", false);
}
}

Expand Down

0 comments on commit 5dc528d

Please sign in to comment.