summaryrefslogtreecommitdiff
path: root/inst/app/www/script.js
blob: c31584fce53d89960bff62c09919103ba7e00151 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$(document).ready(() => {
  // Enable tooltips.
  $('[data-bs-toggle="tooltip"]').tooltip();

  // Toggle the text in the bulk data help button.
  $('#bulk-help-toggle').on('click', event => {
    btn = $(event.target);
    show_format = 'Show required format';
    btn.text(btn.text() === show_format ? 'Hide required format' : show_format);
  });

  // Trigger the file selector via a custom button.
  $('#data-upload-select').on('click', () => {
    $('#data_upload').trigger('click');
  });

  // Display the name of the uploaded file.
  $('#data_upload').on('change', event => {
    $('#data-upload-name').attr('placeholder', event.target.files[0].name);
  });
});