2015-06-07 00:43:51 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* 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
|
|
|
|
**/
|
2015-06-07 00:43:51 +00:00
|
|
|
|
|
|
|
(function ($, Drupal) {
|
|
|
|
|
2015-10-13 22:37:56 +00:00
|
|
|
'use strict';
|
2015-06-07 00:43:51 +00:00
|
|
|
|
|
|
|
Drupal.behaviors.detailsAria = {
|
2017-05-19 22:12:53 +00:00
|
|
|
attach: function attach() {
|
2015-06-07 00:43:51 +00:00
|
|
|
$('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
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal);
|