Commit f3e571c3 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch 'leipert-migrate-path-locks-to-js-only' into 'master'

Move Path Locks inline JavaScript to JS-only

See merge request gitlab-org/gitlab!75945
parents 0b10e345 d7ee98b1
import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
document.addEventListener('DOMContentLoaded', initDeprecatedRemoveRowBehavior);
import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
document.addEventListener('DOMContentLoaded', () => {
initDeprecatedRemoveRowBehavior();
const locks = document.querySelector('.locks');
locks.addEventListener('ajax:success', () => {
const allRowsHidden = [...locks.querySelectorAll('li')].every((x) => x.offsetParent === null);
if (allRowsHidden) {
locks.querySelector('.nothing-here-block.hidden')?.classList?.remove('hidden');
}
});
});
- unless @project.path_locks.any?
var emptyState = document.querySelector('.locks .nothing-here-block.hidden');
if (emptyState) emptyState.classList.remove('hidden');
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment