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