File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 161
161
}
162
162
} ) ;
163
163
}
164
-
164
+ my_calendar_external_links ( ) ;
165
165
my_calendar_edit_toggles ( ) ;
166
166
mc_render_buttons ( ) ;
167
167
if ( 'true' === my_calendar . ajax ) {
278
278
$ ( '.mini .has-events' ) . children ( ) . not ( '.mc-date-container' ) . hide ( ) ;
279
279
}
280
280
mc_render_buttons ( ) ;
281
+ my_calendar_external_links ( ) ;
281
282
my_calendar_edit_toggles ( ) ;
282
283
// All views.
283
284
$ ( '#' + targetId ) . trigger ( 'focus' ) ;
372
373
}
373
374
}
374
375
375
- $ ( '.mc-main a[target=_blank]' ) . append ( ' <span class="dashicons dashicons-external" aria-hidden="true"></span><span class="screen-reader-text"> ' + my_calendar . newWindow + '</span>' ) ;
376
+ function my_calendar_external_links ( ) {
377
+ let external_links = document . querySelectorAll ( '.mc-main a[target=_blank]' ) ;
378
+ external_links . forEach ( ( el ) => {
379
+ el . classList . add ( 'mc-opens-in-new-tab' ) ;
380
+ el . insertAdjacentHTML ( 'beforeend' , ' <span class="dashicons dashicons-external" aria-hidden="true"></span><span class="screen-reader-text"> ' + my_calendar . newWindow + '</span>' ) ;
381
+ } ) ;
382
+ }
376
383
377
384
function my_calendar_edit_toggles ( ) {
378
385
const adminToggles = document . querySelectorAll ( '.mc-toggle-edit' ) ;
You can’t perform that action at this time.
0 commit comments