Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / misc / details-aria.es6.js
index bf92846dac4bfbc76b44ff079520ccd0d7a519e9..a7c6ca5c0b640fcd772e43d6ad85e3c0aa87ba1e 100644 (file)
@@ -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.
    *
    */
   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);