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

index.js « groups « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a63a0dbc6b18dbbf02441d1129ffbc7e0122d129 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import PersistentUserCallout from '~/persistent_user_callout';
import initGkeDropdowns from '~/projects/gke_cluster_dropdowns';

function initGcpSignupCallout() {
  const callout = document.querySelector('.gcp-signup-offer');

  if (callout) new PersistentUserCallout(callout); // eslint-disable-line no-new
}

document.addEventListener('DOMContentLoaded', () => {
  const { page } = document.body.dataset;
  const newClusterViews = [
    'groups:clusters:new',
    'groups:clusters:create_gcp',
    'groups:clusters:create_user',
  ];

  if (newClusterViews.indexOf(page) > -1) {
    initGcpSignupCallout();
    initGkeDropdowns();
  }
});