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

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

Страница интерфейса MediaWiki
Нет описания правки
Нет описания правки
Строка 6: Строка 6:
   if (!cell) return;
   if (!cell) return;
   if(current != null) document.getElementById(current).style.display = "none"
   if(current != null) document.getElementById(current).style.display = "none"
   if(cell.dataset.id == current) return;
   if(cell.dataset.id == current) {
    current = null;
    return;
  }
   current = cell.dataset.id
   current = cell.dataset.id
   document.getElementById(current).style.display = "block"
   document.getElementById(current).style.display = "block"
});
});

Версия от 19:53, 3 августа 2025

current = null;
console.log("1");
table = document.getElementById("law");
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"
});