Skip to content

Commit

Permalink
Merge pull request #5580 from dodona-edu/fix/enableSubmit
Browse files Browse the repository at this point in the history
Don't try to enable submit button when not logged in
  • Loading branch information
jorg-vr authored Jun 4, 2024
2 parents 98a795c + 088a42a commit 4e32c0b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/assets/javascripts/exercise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,21 @@ async function initExerciseShow(exerciseId: number, programmingLanguage: string,
}

function enableSubmitButton(): void {
if (!loggedIn) {
return;
}

const btn = document.getElementById("editor-process-btn") as HTMLButtonElement;
btn.disabled = false;
btn.classList.remove("busy", "mdi-timer-sand-empty", "mdi-spin");
btn.classList.add("mdi-send");
}

function disableSubmitButton(): void {
if (!loggedIn) {
return;
}

const btn = document.getElementById("editor-process-btn") as HTMLButtonElement;
btn.disabled = true;
btn.classList.remove("mdi-send");
Expand Down

0 comments on commit 4e32c0b

Please sign in to comment.