summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/profiles/keys/index.js
blob: d3dcd21f4560fcef7f044987e2fa04c9c05830c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import AddSshKeyValidation from '~/profile/add_ssh_key_validation';

document.addEventListener('DOMContentLoaded', () => {
  const input = document.querySelector('.js-add-ssh-key-validation-input');
  if (!input) return;

  const warning = document.querySelector('.js-add-ssh-key-validation-warning');
  const originalSubmit = input.form.querySelector('.js-add-ssh-key-validation-original-submit');
  const confirmSubmit = warning.querySelector('.js-add-ssh-key-validation-confirm-submit');

  const addSshKeyValidation = new AddSshKeyValidation(
    input,
    warning,
    originalSubmit,
    confirmSubmit,
  );
  addSshKeyValidation.register();
});