16 lines
425 B
JavaScript
16 lines
425 B
JavaScript
(function () {
|
|
var root = document.querySelector("[data-help-faq]");
|
|
if (!root) return;
|
|
|
|
var items = root.querySelectorAll(".help-faq__item");
|
|
|
|
Array.prototype.forEach.call(items, function (item) {
|
|
item.addEventListener("toggle", function () {
|
|
if (!item.open) return;
|
|
Array.prototype.forEach.call(items, function (other) {
|
|
if (other !== item) other.open = false;
|
|
});
|
|
});
|
|
});
|
|
})();
|