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