getMetadata()

in source/static-assets/js/main.js [19:47]


  getMetadata().then(function (returnedMetadata) {
    metadata = returnedMetadata
    return getEndpoints()
  }).then(function (returnedEndpoints) {
    endpoints = returnedEndpoints
    loadMetadata()
    loadUser()

    // Input Masks
    $(':input').inputmask()

    // Form Validation
    $('#form').validetta({
      display: 'bubble',
      bubblePosition: 'bottom',
      errorClass: 'validetta-error',
      realTime: true
    }, metadata.text.inputValidationMessages)

    //Tooltips
    tlite(el => el.classList.contains('tooltip'));

    hideLoader()
    showForm()
  }).catch(function (e) {
    console.error('Error:', e)
    hideLoader()
    showError('There was an error loading the preference center.')
  })