Skip to content

Commit

Permalink
Only run query selector once
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Sep 22, 2023
1 parent dbc6b2c commit c15e573
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/views/evaluations/show.js.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
dodona.setHTMLExecuteScripts(document.querySelector("#evaluation-table-wrapper"), "<%= escape_javascript(render 'evaluation_table', feedbacks: @feedbacks, evaluation: @evaluation, users: @users) %>")
if(document.querySelector("#evaluation-grade-table-wrapper")) {
dodona.setHTMLExecuteScripts(document.querySelector("#evaluation-grade-table-wrapper"), "<%= escape_javascript(render 'evaluation_grade_table', feedbacks: @feedbacks, evaluation: @evaluation, users: @users) %>")
{
const gradeTable = document.querySelector("#evaluation-grade-table-wrapper");
if(gradeTable) {
dodona.setHTMLExecuteScripts(gradeTable, "<%= escape_javascript(render 'evaluation_grade_table', feedbacks: @feedbacks, evaluation: @evaluation, users: @users) %>")
}
}

0 comments on commit c15e573

Please sign in to comment.