MediaWiki:Common.js: различия между версиями
Страница интерфейса MediaWiki
Дополнительные действия
Admin (обсуждение | вклад) Нет описания правки |
Admin (обсуждение | вклад) Нет описания правки |
||
| Строка 12: | Строка 12: | ||
document.getElementById(current).style.display = "block" | document.getElementById(current).style.display = "block" | ||
}); | }); | ||
mw.loader.using('jquery', function () { | mw.loader.using('jquery', function () { | ||
Версия от 23:54, 3 августа 2025
current = null;
table = document.getElementById("law");
if(table) table.addEventListener("click", function (event) {
const cell = event.target.closest("td");
if (!cell) return;
if(current != null) document.getElementById(current).style.display = "none"
if(cell.dataset.id == current) {
current = null;
return;
}
current = cell.dataset.id
document.getElementById(current).style.display = "block"
});
mw.loader.using('jquery', function () {
$(function () {
$('.vtabs').each(function () {
const $container = $(this);
const $buttons = $container.find('.vtabs-button');
const $contents = $container.find('.vtabs-content');
$buttons.each(function (index) {
$(this).on('click', function () {
$buttons.removeClass('active');
$contents.removeClass('active');
$(this).addClass('active');
$contents.eq(index).addClass('active');
});
});
});
});
});