mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-77241 course: optional chaining safety for section toggles.
This commit is contained in:
parent
1ea152c99a
commit
34e7f27664
3 changed files with 3 additions and 3 deletions
2
course/format/amd/build/local/content.min.js
vendored
2
course/format/amd/build/local/content.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -163,7 +163,7 @@ export default class Component extends BaseComponent {
|
|||
const closestCollapse = event.target.closest(this.selectors.COLLAPSE);
|
||||
// Assume that chevron is the only collapse toggler in a section heading;
|
||||
// I think this is the most efficient way to verify at the moment.
|
||||
const isChevron = closestCollapse.closest(this.selectors.SECTION_ITEM);
|
||||
const isChevron = closestCollapse?.closest(this.selectors.SECTION_ITEM);
|
||||
|
||||
if (sectionlink || isChevron) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue