Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dom.js « utils « repository « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b667cd53b183f2b89273dcf0c7e439c7a041cacf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { joinPaths } from '~/lib/utils/url_utility';

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 = joinPaths(basePath, path);
  }
};