Fix enable/disable toggle of buttons etc. with new client.isBusy field.

This commit is contained in:
Stephan Porada
2020-09-09 14:35:00 +02:00
parent ff7881662c
commit 9ae74cc9de
6 changed files with 80 additions and 90 deletions

View File

@ -257,7 +257,7 @@ document.addEventListener("DOMContentLoaded", () => {
resultsList.expertModeOff('query-display');
}
// Activates inspect buttons on new page if client is not busy.
resultsList.activateInspect();
resultsList.toggleInspectButtons(client);
});
}
@ -291,10 +291,10 @@ document.addEventListener("DOMContentLoaded", () => {
* Following event listeners handle the change of Context size per match and
* the number of matches shown per page.
*/
resultsList.displayOptionsFormResultsPerPage.onchange = () => {
resultsList.changeHitsPerPage();
resultsList.displayOptionsFormResultsPerPage.onchange = (event) => {
resultsList.changeHitsPerPage(client, results);
};
resultsList.displayOptionsFormResultContext.onchange = () => {
resultsList.displayOptionsFormResultContext.onchange = (event) => {
resultsList.changeContext();
};
@ -332,7 +332,7 @@ document.addEventListener("DOMContentLoaded", () => {
* 5. Download single inspect-results
*/
// 1. Add events for full-results create
resultsList.fullResultsCreate.onclick = () => {
resultsList.fullResultsCreate.onclick = (event) => {
resultsList.fullResultsCreate.querySelector('i').classList.toggle('hide');
resultsList.fullResultsCreate.innerText = 'Creating...';
resultsList.fullResultsCreate.insertAdjacentHTML('afterbegin',
@ -342,7 +342,7 @@ document.addEventListener("DOMContentLoaded", () => {
dataIndexes: dataIndexes});
}
// 2. Add events for sub-results create
resultsList.subResultsCreate.onclick = () => {
resultsList.subResultsCreate.onclick = (event) => {
let dataIndexes = [];
resultsList.addToSubResultsIdsToShow.forEach((id) => {
dataIndexes.push(id - 1);
@ -357,10 +357,10 @@ document.addEventListener("DOMContentLoaded", () => {
// Before the download events are added the needed modal is initialized.
resultsList.queryResultsDownloadModal = M.Modal.init(resultsList.queryResultsDownloadModal);
// 3. Open download modal when full results export button is pressed
resultsList.fullResultsExport.onclick = () => {
resultsList.fullResultsExport.onclick = (event) => {
resultsList.queryResultsDownloadModal.open();
// add onclick to download JSON button and download the file
resultsList.downloadResultsJson.onclick = () => {
resultsList.downloadResultsJson.onclick = (event) => {
let filename = results.fullResultsData.createDownloadFilename('full-results');
results.fullResultsData.addData(results.metaData);
results.fullResultsData.downloadJSONRessource(filename,
@ -368,10 +368,10 @@ document.addEventListener("DOMContentLoaded", () => {
resultsList.downloadResultsJson)};
}
// 4. Open download modal when sub results export button is pressed
resultsList.subResultsExport.onclick = () => {
resultsList.subResultsExport.onclick = (event) => {
resultsList.queryResultsDownloadModal.open();
// add onclick to download JSON button and download the file
resultsList.downloadResultsJson.onclick = () => {
resultsList.downloadResultsJson.onclick = (event) => {
let filename = results.subResultsData.createDownloadFilename('sub-results');
results.subResultsData.addData(results.metaData);
results.subResultsData.downloadJSONRessource(filename,
@ -379,10 +379,10 @@ document.addEventListener("DOMContentLoaded", () => {
resultsList.downloadResultsJson)};
}
// 5. Open download modal when inspect-results-export button is pressed
resultsList.inspectResultsExport.onclick = () => {
resultsList.inspectResultsExport.onclick = (event) => {
resultsList.queryResultsDownloadModal.open();
// add onclick to download JSON button and download the file
resultsList.downloadResultsJson.onclick = () => {
resultsList.downloadResultsJson.onclick = (event) => {
let filename = results.subResultsData.createDownloadFilename('inspect-results');
results.subResultsData.addData(results.metaData);
results.subResultsData.downloadJSONRessource(filename,