pure/site/static/js/grids.js
2020-04-27 10:42:40 -07:00

17 lines
497 B
JavaScript

(function (window, document) {
var unitsToggle = document.querySelector('.grids-show-all'),
notReducedUnits = document.querySelectorAll('.grids-unit-not-reduced');
unitsToggle.onclick = function (e) {
[].slice.call(notReducedUnits).forEach(function (unit) {
if (e.target.checked) {
unit.removeAttribute('hidden');
} else {
unit.setAttribute('hidden');
}
});
};
}(this, this.document));