Mercurial > hg > cmmr2012-drupal-site
comparison core/misc/details-aria.js @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 /** | |
2 * DO NOT EDIT THIS FILE. | |
3 * See the following change record for more information, | |
4 * https://www.drupal.org/node/2815083 | |
5 * @preserve | |
6 **/ | |
7 | |
8 (function ($, Drupal) { | |
9 Drupal.behaviors.detailsAria = { | |
10 attach: function attach() { | |
11 $('body').once('detailsAria').on('click.detailsAria', 'summary', function (event) { | |
12 var $summary = $(event.currentTarget); | |
13 var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true'; | |
14 | |
15 $summary.attr({ | |
16 'aria-expanded': open, | |
17 'aria-pressed': open | |
18 }); | |
19 }); | |
20 } | |
21 }; | |
22 })(jQuery, Drupal); |