updated core to 8.6.1 via composer
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Add aria attribute handling for details and summary elements.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
(function($, Drupal) {
|
||||
/**
|
||||
* Handles `aria-expanded` and `aria-pressed` attributes on details elements.
|
||||
*
|
||||
@@ -11,15 +11,20 @@
|
||||
*/
|
||||
Drupal.behaviors.detailsAria = {
|
||||
attach() {
|
||||
$('body').once('detailsAria').on('click.detailsAria', 'summary', (event) => {
|
||||
const $summary = $(event.currentTarget);
|
||||
const open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true';
|
||||
$('body')
|
||||
.once('detailsAria')
|
||||
.on('click.detailsAria', 'summary', event => {
|
||||
const $summary = $(event.currentTarget);
|
||||
const open =
|
||||
$(event.currentTarget.parentNode).attr('open') === 'open'
|
||||
? 'false'
|
||||
: 'true';
|
||||
|
||||
$summary.attr({
|
||||
'aria-expanded': open,
|
||||
'aria-pressed': open,
|
||||
$summary.attr({
|
||||
'aria-expanded': open,
|
||||
'aria-pressed': open,
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
}(jQuery, Drupal));
|
||||
})(jQuery, Drupal);
|
||||
|
||||
Reference in New Issue
Block a user