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,12 +73,17 @@ function download(downloadElem, dataStr, filename, type, filenameSlug) {
// ###### Functions to inspect one match, to show more details ######
// activate inspect buttons if queryFinished is true
function activateInspect(progress) {
function activateInspect() {
console.log("activation progress", progress);
if (progress === 100) {
let inspectBtnElements;
inspectBtnElements = document.getElementsByClassName("inspect");
for (let inspectBtn of inspectBtnElements) {
inspectBtn.classList.remove("disabled");
}
} else {
return
}
}
//gets result cpos infos for one dataIndex to send back to the server

View File

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

View File

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