Skip to content

Commit

Permalink
repurpose show/hide button
Browse files Browse the repository at this point in the history
  • Loading branch information
bmesuere committed Nov 5, 2023
1 parent 48cdfc9 commit 78577e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/assets/javascripts/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ function initSubmissionShow(parentClass: string, mediaPath: string, token: strin
tabButtons.forEach( b => b.classList.remove("active"));
button.classList.add("active");
if (button.dataset.show === "true") {
tab.querySelectorAll(".group.correct").forEach((testcase: HTMLElement) => {
testcase.style.display = "block";
tab.querySelectorAll(".group.correct").forEach((group: HTMLElement) => {
group.classList.remove("collapsed");

Check warning on line 50 in app/assets/javascripts/submission.ts

View check run for this annotation

Codecov / codecov/patch

app/assets/javascripts/submission.ts#L49-L50

Added lines #L49 - L50 were not covered by tests
});
} else {
tab.querySelectorAll(".group.correct").forEach((testcase: HTMLElement) => {
testcase.style.display = "none";
tab.querySelectorAll(".group.correct").forEach((group: HTMLElement) => {
group.classList.add("collapsed");

Check warning on line 54 in app/assets/javascripts/submission.ts

View check run for this annotation

Codecov / codecov/patch

app/assets/javascripts/submission.ts#L53-L54

Added lines #L53 - L54 were not covered by tests
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/renderers/feedback_table_renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ def tab_content(t, tab_i)
@builder << I18n.t('submissions.show.correct_tests')
end
@builder.div(class: 'btn-group btn-toggle') do
@builder.button(class: 'btn active', 'data-show': 'true', title: I18n.t('submissions.show.correct.shown'), 'data-bs-toggle': 'tooltip', 'data-bs-placement': 'top') do
@builder.button(class: 'btn', 'data-show': 'true', title: I18n.t('submissions.show.correct.shown'), 'data-bs-toggle': 'tooltip', 'data-bs-placement': 'top') do

Check warning on line 157 in app/helpers/renderers/feedback_table_renderer.rb

View check run for this annotation

Codecov / codecov/patch

app/helpers/renderers/feedback_table_renderer.rb#L157

Added line #L157 was not covered by tests
@builder.i('', class: 'mdi mdi-eye')
end
@builder.button(class: 'btn', 'data-show': 'false', title: I18n.t('submissions.show.correct.hidden'), 'data-bs-toggle': 'tooltip', 'data-bs-placement': 'top') do
@builder.button(class: 'btn active', 'data-show': 'false', title: I18n.t('submissions.show.correct.hidden'), 'data-bs-toggle': 'tooltip', 'data-bs-placement': 'top') do

Check warning on line 160 in app/helpers/renderers/feedback_table_renderer.rb

View check run for this annotation

Codecov / codecov/patch

app/helpers/renderers/feedback_table_renderer.rb#L160

Added line #L160 was not covered by tests
@builder.i('', class: 'mdi mdi-eye-off')
end
end
Expand Down

0 comments on commit 78577e6

Please sign in to comment.