diff --git a/templates/completion-rules-scope-switcher.mustache b/templates/completion-rules-scope-switcher.mustache index 70e2a6f..2fd7af2 100644 --- a/templates/completion-rules-scope-switcher.mustache +++ b/templates/completion-rules-scope-switcher.mustache @@ -56,12 +56,12 @@ {{#js}} require(['block_xp/course-selector'], function(CourseSelector) { - const trigger = document.getElementById('block_xp-course-selector-{{uniqid}}'); - const courseUrlTemplate = "{{ courseurltemplate }}"; - trigger.addEventListener('click', () => { + var trigger = document.getElementById('block_xp-course-selector-{{uniqid}}'); + var courseUrlTemplate = "{{ courseurltemplate }}"; + trigger.addEventListener('click', function() { CourseSelector.openCourseSelector(function(course) { window.location.href = courseUrlTemplate.replace('CONTEXTID', course.contextid); }); - }) + }); }); {{/js}} \ No newline at end of file