Add global prgress for inspect activation

This commit is contained in:
Stephan Porada 2020-04-06 15:27:25 +02:00
parent b78558fc03
commit 961027a8f7
3 changed files with 14 additions and 7 deletions

View File

@ -73,11 +73,16 @@ function download(downloadElem, dataStr, filename, type, filenameSlug) {
// ###### Functions to inspect one match, to show more details ###### // ###### Functions to inspect one match, to show more details ######
// activate inspect buttons if queryFinished is true // activate inspect buttons if queryFinished is true
function activateInspect(progress) { function activateInspect() {
let inspectBtnElements; console.log("activation progress", progress);
inspectBtnElements = document.getElementsByClassName("inspect"); if (progress === 100) {
for (let inspectBtn of inspectBtnElements) { let inspectBtnElements;
inspectBtn.classList.remove("disabled"); inspectBtnElements = document.getElementsByClassName("inspect");
for (let inspectBtn of inspectBtnElements) {
inspectBtn.classList.remove("disabled");
}
} else {
return
} }
} }

View File

@ -50,7 +50,8 @@ function queryRenderResults(payload) {
textLookupCountElement.innerText = `${Object.keys(results.resultsJSON.text_lookup).length}`; textLookupCountElement.innerText = `${Object.keys(results.resultsJSON.text_lookup).length}`;
console.log("Results recieved:", results.resultsJSON); console.log("Results recieved:", results.resultsJSON);
// upate progress status // upate progress status
if (payload.progress === 100) { progress = payload.progress; // global declaration
if (progress === 100) {
queryResultsProgressElement.classList.add("hide"); queryResultsProgressElement.classList.add("hide");
queryResultsUserFeedbackElement.classList.add("hide"); queryResultsUserFeedbackElement.classList.add("hide");
queryResultsExportElement.classList.remove("disabled"); queryResultsExportElement.classList.remove("disabled");

View File

@ -230,6 +230,7 @@
var resultsList; // resultsList object var resultsList; // resultsList object
var queryFormElement; // the query form var queryFormElement; // the query form
var collapsibleElements; // all collapsibles on site var collapsibleElements; // all collapsibles on site
var progress; // global progress value
var queryResultsProgressElement; // Div element holding the progress bar var queryResultsProgressElement; // Div element holding the progress bar
var queryResultsDeterminateElement; // The progress bar for recieved results var queryResultsDeterminateElement; // The progress bar for recieved results
var queryResultsUserFeedbackElement; // Element showing match count|total etc var queryResultsUserFeedbackElement; // Element showing match count|total etc
@ -361,7 +362,7 @@
expertModeOff(currentTokenElements); expertModeOff(currentTokenElements);
console.log("unchecked! Destroy"); console.log("unchecked! Destroy");
} }
}) });
}); });
// Add onclick to open download modal when Export Results button is pressed // Add onclick to open download modal when Export Results button is pressed