MediaWiki:Common.js: различия между версиями
Wikiroot (обсуждение | вклад) (Полностью удалено содержимое страницы) Метки: очистка ручная отмена |
Wikiroot (обсуждение | вклад) Нет описания правки Метка: отменено |
||
Строка 1: | Строка 1: | ||
document.querySelectorAll('#category-tree li > a').forEach(function(anchor) { | |||
anchor.addEventListener('click', function(event) { | |||
event.preventDefault(); | |||
var childUl = this.nextElementSibling; | |||
if (childUl) { | |||
childUl.style.display = (childUl.style.display === 'none') ? 'block' : 'none'; | |||
} | |||
}); | |||
}); |
Версия от 07:57, 20 августа 2024
document.querySelectorAll('#category-tree li > a').forEach(function(anchor) { anchor.addEventListener('click', function(event) { event.preventDefault(); var childUl = this.nextElementSibling; if (childUl) { childUl.style.display = (childUl.style.display === 'none') ? 'block' : 'none'; } }); });