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

setup_root_element.js « gitlab_web_ide « lib « ide « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0e06c88d26cc2162355cc24f5aeefb05f7679b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/**
 * Cleans up the given element and prepares it for mounting to `@gitlab/web-ide`
 *
 * @param {Element} root The original root element
 * @returns {Element} A new element ready to be used by `@gitlab/web-ide`
 */
export const setupRootElement = (el) => {
  const newEl = document.createElement(el.tagName);
  newEl.id = el.id;
  newEl.classList.add('gl--flex-center', 'gl-relative', 'gl-h-full');
  el.replaceWith(newEl);

  return newEl;
};