{"version":3,"file":"accordions.js","sources":["accordions.js"],"sourcesContent":["/**\n * @file\n * A JavaScript file to set up accordions.\n *\n */\n\n(function (Drupal, $) {\n\n var event = (navigator.userAgent.match(/iPhone/i)) ? \"touchstart\" : \"click\";\n\n /**\n * Set the Collapse functions\n *\n */\n function setAccordions(trigger,block) {\n\n // Attach click function for button toggle\n $(trigger).each(function() {\n\n $(this)\n .off(event)\n .on(event, function(e) {\n // Add accordion functionality\n $(this).toggleClass('open').next(block).slideToggle('500');\n // Amend aria values as needed\n if ($(this).hasClass('open')) {\n $(this).attr('aria-expanded', 'true')\n .next(block).attr('aria-hidden', 'false');\n } else {\n $(this).attr('aria-expanded', 'false')\n .next(block).attr('aria-hidden', 'true');\n }\n });\n });\n\n // Everything should be closed on page load\n $(block).hide();\n }\n\n // Call function\n setAccordions('.accordion__button', '.accordion__content');\n\n} (Drupal, jQuery));\n"],"names":["$","block","event","navigator","userAgent","match","each","this","off","on","e","toggleClass","next","slideToggle","hasClass","attr","hide","Drupal","jQuery"],"mappings":"CAMC,SAAkBA,GAEjB,IAM+BC,EAN3BC,EAASC,UAAUC,UAAUC,MAAM,WAAc,aAAe,QAMrCJ,EA0BK,sBAvBlCD,EAuBY,sBAvBDM,KAAK,WAEdN,EAAEO,MACCC,IAAIN,GACJO,GAAGP,EAAO,SAASQ,GAElBV,EAAEO,MAAMI,YAAY,QAAQC,KAAKX,GAAOY,YAAY,OAEhDb,EAAEO,MAAMO,SAAS,QACnBd,EAAEO,MAAMQ,KAAK,gBAAiB,QAC3BH,KAAKX,GAAOc,KAAK,cAAe,SAEnCf,EAAEO,MAAMQ,KAAK,gBAAiB,SAC3BH,KAAKX,GAAOc,KAAK,cAAe,YAM3Cf,EAAEC,GAAOe,OA9Bb,EAoCGC,OAAQC"}