diff --git a/vault/static/vault/js/vault.js b/vault/static/vault/js/vault.js index 708fc4c1..bf68fcc0 100644 --- a/vault/static/vault/js/vault.js +++ b/vault/static/vault/js/vault.js @@ -10,6 +10,8 @@ $(document).ajaxSend(function (e, request, settings) { } }) +let downloadChecksumReportTextTooltip +let downloadChecksumReportCSVTooltip let preservableFormatsLists = null let currentFolder let dataPackage = null @@ -24,6 +26,8 @@ $(function () { // Canonicalize path somewhat, for convenience. currentFolder = currentFolder.replace(/\/+/g, '/').replace(/\/$/, '') + createTooltips() + if ($('#file-browser').length) { // startBrowsing(browsePageItems); startBrowsing() @@ -49,8 +53,6 @@ $(function () { $('#showChecksumReport .collection').text(folder) $('#showChecksumReport .modal-body #checksumReport').html('') - $('#showChecksumReport .modal-footer .download-report-text').addClass('d-none') - $('#showChecksumReport .modal-footer .download-report-csv').addClass('d-none') $('#showChecksumReport .modal-footer .download-report-text').attr('href', downloadUrl + '&format=text') $('#showChecksumReport .modal-footer .download-report-csv').attr('href', downloadUrl + '&format=csv') @@ -59,23 +61,35 @@ $(function () { let table = '
Filename | Size | Checksum |
---|---|---|
${obj.name} | -${obj.size} | -${obj.checksum} | -${obj.name} | +${obj.size} | +${obj.checksum} | + ` + }) + if (downloadChecksumReportTextTooltip) { + downloadChecksumReportTextTooltip.disable() } - }) + if (downloadChecksumReportCSVTooltip) { + downloadChecksumReportCSVTooltip.disable() + } + } else { + $('#showChecksumReport .modal-footer .download-report-text').removeAttr('href') + $('#showChecksumReport .modal-footer .download-report-csv').removeAttr('href') + if (downloadChecksumReportTextTooltip) { + downloadChecksumReportTextTooltip.enable() + } + if (downloadChecksumReportCSVTooltip) { + downloadChecksumReportCSVTooltip.enable() + } + } table += '