Skip to content

Commit ecc2ef8

Browse files
committed
Bug fix: wrong ID passed to mc_build_toggles
1 parent 84ac808 commit ecc2ef8

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

src/js/mcjs.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
const { __, _x, _n, _nx } = wp.i18n;
33

44
'use strict';
5-
$(function () {
6-
mc_display_usertime();
7-
const calendar = document.querySelectorAll( '.mc-main, .mc-event-list' );
8-
if ( calendar ) {
9-
calendar.forEach( (el) => {
10-
let targetId = el.getAttribute( 'id' );
11-
mc_build_toggles( targetId );
12-
el.classList.remove( 'mcjs' );
13-
});
14-
}
15-
});
5+
mc_display_usertime();
6+
const calendar = document.querySelectorAll( '.mc-main, .mc-event-list' );
7+
if ( calendar ) {
8+
calendar.forEach( (el) => {
9+
let targetId = el.getAttribute( 'id' );
10+
mc_build_toggles( targetId );
11+
el.classList.remove( 'mcjs' );
12+
});
13+
}
1614

1715
const loadmore = document.querySelectorAll( '.mc-loader' );
1816
if ( loadmore ) {
@@ -286,7 +284,7 @@
286284
let refText = $( '#mc_head_' + ref ).text();
287285
wp.a11y.speak( refText );
288286
mc_display_usertime();
289-
mc_build_toggles( targetId );
287+
mc_build_toggles( ref );
290288
my_calendar_table_aria();
291289
});
292290
}
@@ -426,5 +424,5 @@
426424
}
427425
}
428426
my_calendar_table_aria();
429-
427+
430428
}(jQuery));

0 commit comments

Comments
 (0)