drupal/core/misc/details-aria.js

26 lines
686 B
JavaScript
Raw Normal View History

/**
* DO NOT EDIT THIS FILE.
* All changes should be applied to ./misc/details-aria.es6.js
* See the following change record for more information,
* https://www.drupal.org/node/2873849
* @preserve
**/
(function ($, Drupal) {
'use strict';
Drupal.behaviors.detailsAria = {
attach: function attach() {
$('body').once('detailsAria').on('click.detailsAria', 'summary', function (event) {
var $summary = $(event.currentTarget);
var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true';
$summary.attr({
'aria-expanded': open,
'aria-pressed': open
});
});
}
};
})(jQuery, Drupal);