debian-mirror-gitlab/app/assets/javascripts/repository/utils/dom.js
2020-01-01 13:55:28 +05:30

11 lines
346 B
JavaScript

export const updateElementsVisibility = (selector, isVisible) => {
document.querySelectorAll(selector).forEach(elem => elem.classList.toggle('hidden', !isVisible));
};
export const updateFormAction = (selector, basePath, path) => {
const form = document.querySelector(selector);
if (form) {
form.action = `${basePath}${path}`;
}
};