2023-11-02 08:49:02 -06:00
|
|
|
export function initRepoPullRequestCommitStatus() {
|
|
|
|
for (const btn of document.querySelectorAll('.commit-status-hide-checks')) {
|
|
|
|
const panel = btn.closest('.commit-status-panel');
|
2024-12-11 01:29:04 -07:00
|
|
|
const list = panel.querySelector<HTMLElement>('.commit-status-list');
|
2023-11-02 08:49:02 -06:00
|
|
|
btn.addEventListener('click', () => {
|
|
|
|
list.style.maxHeight = list.style.maxHeight ? '' : '0px'; // toggle
|
|
|
|
btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|