Открыть меню
Переключить меню настроек
Открыть персональное меню
Вы не представились системе
Ваш IP-адрес будет виден всем, если вы внесёте какие-либо изменения.

MediaWiki:Common.js: различия между версиями

Страница интерфейса MediaWiki
Нет описания правки
Нет описания правки
Строка 1: Строка 1:
current = null;
let current = null;
table = document.getElementById("law");
let currentCell = null;
if(table) table.addEventListener("click", function (event) {
const table = document.getElementById("law");
  const cell = event.target.closest("td");
if (table) {
  if (!cell) return;
  table.addEventListener("click", function (event) {
  if(current != null) document.getElementById(current).style.display = "none"
    const cell = event.target.closest("td");
  if(cell.dataset.id == current) {
    if (!cell) return;
    current = null;
 
    return;
    if (current !== null) {
  }
      document.getElementById(current).style.display = "none";
  current = cell.dataset.id
      if (currentCell) currentCell.classList.remove("law-selected");
  document.getElementById(current).style.display = "block"
    }
});
 
    if (cell.dataset.id === current) {
      current = null;
      currentCell = null;
      return;
    }
 
    current = cell.dataset.id;
    currentCell = cell;
 
    document.getElementById(current).style.display = "block";
    cell.classList.add("law-selected");
  });
}


mw.loader.using('jquery', function () {
mw.loader.using('jquery', function () {