debian-mirror-gitlab/app/assets/javascripts/repository/utils/dom.js

16 lines
417 B
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import { joinPaths } from '~/lib/utils/url_utility';
2019-12-26 22:10:19 +05:30
export const updateElementsVisibility = (selector, isVisible) => {
2021-03-08 18:12:59 +05:30
document
.querySelectorAll(selector)
.forEach((elem) => elem.classList.toggle('hidden', !isVisible));
2019-12-26 22:10:19 +05:30
};
2020-01-01 13:55:28 +05:30
export const updateFormAction = (selector, basePath, path) => {
const form = document.querySelector(selector);
if (form) {
2020-03-13 15:44:24 +05:30
form.action = joinPaths(basePath, path);
2020-01-01 13:55:28 +05:30
}
};