Mercurial > hg > cmmr2012-drupal-site
annotate core/misc/details-aria.js @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | c75dbcec494b |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * DO NOT EDIT THIS FILE. |
Chris@0 | 3 * See the following change record for more information, |
Chris@0 | 4 * https://www.drupal.org/node/2815083 |
Chris@0 | 5 * @preserve |
Chris@0 | 6 **/ |
Chris@0 | 7 |
Chris@0 | 8 (function ($, Drupal) { |
Chris@0 | 9 Drupal.behaviors.detailsAria = { |
Chris@0 | 10 attach: function attach() { |
Chris@0 | 11 $('body').once('detailsAria').on('click.detailsAria', 'summary', function (event) { |
Chris@0 | 12 var $summary = $(event.currentTarget); |
Chris@0 | 13 var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true'; |
Chris@0 | 14 |
Chris@0 | 15 $summary.attr({ |
Chris@0 | 16 'aria-expanded': open, |
Chris@0 | 17 'aria-pressed': open |
Chris@0 | 18 }); |
Chris@0 | 19 }); |
Chris@0 | 20 } |
Chris@0 | 21 }; |
Chris@0 | 22 })(jQuery, Drupal); |