MediaWiki:Common.js: различия между версиями
Страница интерфейса MediaWiki
Дополнительные действия
Admin (обсуждение | вклад) Нет описания правки |
Admin (обсуждение | вклад) Нет описания правки |
||
| Строка 13: | Строка 13: | ||
}); | }); | ||
console.log(" | console.log("2") | ||
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'); | |||
}); | |||
}); | }); | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
Версия от 22:33, 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"
});
console.log("2")
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');
});
});
});
});
});