Issue #665790 by chrisrockwell, Sumit kumar, lauriii, joelpittet, sun, vulcanr, vaplas, yoroy, leahtard, tompagabor, aspilicious, ckrina, Gábor Hojtsy, David_Rothstein, Manuel Garcia, rootwork, nod_, kostyashupenko, pguillard, Bojhan, droplet, typhonius, wturrell, mgifford, webkenny, cosmicdreams, tkoleary, YesCT, marcvangend, markabur, LewisNyman, mrfelton, oriol_e9g, prabhu9484, catch, hedrickbt, tsvenson, longwave, dww, kika, borisson_, rdellis87, realityloop, klonos: Redesign the status report page
2017-02-07 20:44:09 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
Issue #665790 by chrisrockwell, Sumit kumar, lauriii, joelpittet, sun, vulcanr, vaplas, yoroy, leahtard, tompagabor, aspilicious, ckrina, Gábor Hojtsy, David_Rothstein, Manuel Garcia, rootwork, nod_, kostyashupenko, pguillard, Bojhan, droplet, typhonius, wturrell, mgifford, webkenny, cosmicdreams, tkoleary, YesCT, marcvangend, markabur, LewisNyman, mrfelton, oriol_e9g, prabhu9484, catch, hedrickbt, tsvenson, longwave, dww, kika, borisson_, rdellis87, realityloop, klonos: Redesign the status report page
2017-02-07 20:44:09 +00:00
|
|
|
|
|
|
|
(function ($, Drupal) {
|
|
|
|
Drupal.behaviors.responsiveDetails = {
|
2017-05-19 22:12:53 +00:00
|
|
|
attach: function attach(context) {
|
Issue #665790 by chrisrockwell, Sumit kumar, lauriii, joelpittet, sun, vulcanr, vaplas, yoroy, leahtard, tompagabor, aspilicious, ckrina, Gábor Hojtsy, David_Rothstein, Manuel Garcia, rootwork, nod_, kostyashupenko, pguillard, Bojhan, droplet, typhonius, wturrell, mgifford, webkenny, cosmicdreams, tkoleary, YesCT, marcvangend, markabur, LewisNyman, mrfelton, oriol_e9g, prabhu9484, catch, hedrickbt, tsvenson, longwave, dww, kika, borisson_, rdellis87, realityloop, klonos: Redesign the status report page
2017-02-07 20:44:09 +00:00
|
|
|
var $details = $(context).find('details').once('responsive-details');
|
|
|
|
|
|
|
|
if (!$details.length) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-03-05 09:14:08 +00:00
|
|
|
var $summaries = $details.find('> summary');
|
|
|
|
|
Issue #665790 by chrisrockwell, Sumit kumar, lauriii, joelpittet, sun, vulcanr, vaplas, yoroy, leahtard, tompagabor, aspilicious, ckrina, Gábor Hojtsy, David_Rothstein, Manuel Garcia, rootwork, nod_, kostyashupenko, pguillard, Bojhan, droplet, typhonius, wturrell, mgifford, webkenny, cosmicdreams, tkoleary, YesCT, marcvangend, markabur, LewisNyman, mrfelton, oriol_e9g, prabhu9484, catch, hedrickbt, tsvenson, longwave, dww, kika, borisson_, rdellis87, realityloop, klonos: Redesign the status report page
2017-02-07 20:44:09 +00:00
|
|
|
function detailsToggle(matches) {
|
|
|
|
if (matches) {
|
|
|
|
$details.attr('open', true);
|
|
|
|
$summaries.attr('aria-expanded', true);
|
|
|
|
$summaries.on('click.details-open', false);
|
2017-05-19 22:12:53 +00:00
|
|
|
} else {
|
|
|
|
var $notPressed = $details.find('> summary[aria-pressed!=true]').attr('aria-expanded', false);
|
|
|
|
$notPressed.parent('details').attr('open', false);
|
Issue #665790 by chrisrockwell, Sumit kumar, lauriii, joelpittet, sun, vulcanr, vaplas, yoroy, leahtard, tompagabor, aspilicious, ckrina, Gábor Hojtsy, David_Rothstein, Manuel Garcia, rootwork, nod_, kostyashupenko, pguillard, Bojhan, droplet, typhonius, wturrell, mgifford, webkenny, cosmicdreams, tkoleary, YesCT, marcvangend, markabur, LewisNyman, mrfelton, oriol_e9g, prabhu9484, catch, hedrickbt, tsvenson, longwave, dww, kika, borisson_, rdellis87, realityloop, klonos: Redesign the status report page
2017-02-07 20:44:09 +00:00
|
|
|
$summaries.off('.details-open');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleDetailsMQ(event) {
|
|
|
|
detailsToggle(event.matches);
|
|
|
|
}
|
|
|
|
|
|
|
|
var mql = window.matchMedia('(min-width:48em)');
|
|
|
|
mql.addListener(handleDetailsMQ);
|
|
|
|
detailsToggle(mql.matches);
|
|
|
|
}
|
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal);
|