Use var for window-wide variables

Otherwise, Turbolinks might cause an issue...

Fixes CODEOCEAN-FRONTEND-H
This commit is contained in:
Sebastian Serth
2023-11-05 23:43:32 +01:00
parent abf917ae37
commit d2b2deaf98

View File

@ -1,8 +1,8 @@
$(document).on('turbolinks:load', function () {
if (window.location.pathname.includes('/implement')) {
const editor = $('#editor');
const exercise_id = editor.data('exercise-id');
var editor = $('#editor');
var exercise_id = editor.data('exercise-id');
if ($.isController('exercises') && ProgrammingGroups.is_other_user(current_contributor)) {