Fix rseults only showing after page navigation in import viewer

This commit is contained in:
Stephan Porada 2020-07-14 15:51:02 +02:00
parent e9eaa49826
commit 13a6ef95c3
2 changed files with 28 additions and 22 deletions

View File

@ -85,15 +85,42 @@ function queryRenderResults(payload, imported=false) {
for (let item of items) {
item.elm = results.jsList.createResultRowElement(item, payload.chunk);
}
helperQueryRenderResults(payload);
if (progress === 100) {
queryResultsProgressElement.classList.add("hide");
queryResultsUserFeedbackElement.classList.add("hide");
queryResultsExportElement.classList.remove("disabled");
addToSubResultsElement.removeAttribute("disabled");
// inital expert mode check and sub results activation
results.jsList.activateInspect();
if (addToSubResultsElement.checked) {
results.jsList.activateAddToSubResults();
}
if (expertModeSwitchElement.checked) {
results.jsList.expertModeOn("query-display");
}
}
});
} else {
} else if (imported) {
results.jsList.add(resultItems, (items) => {
for (let item of items) {
item.elm = results.jsList.createResultRowElement(item, payload.chunk,
true);
}
helperQueryRenderResults(payload);
progress = 100;
console.log(progress);
results.jsList.activateInspect();
if (expertModeSwitchElement.checked) {
results.jsList.expertModeOn("query-display");
}
});
}
}
function helperQueryRenderResults (payload) {
// updating table on finished item creation callback via createResultRowElement
results.jsList.update();
results.jsList.changeContext(); // sets lr context on first result load
// incorporating new chunk results into full results
results.data.matches.push(...payload.chunk.matches);
@ -110,24 +137,4 @@ function queryRenderResults(payload, imported=false) {
console.log("Results recieved:", results.data);
// upate progress status
progress = payload.progress; // global declaration
if (progress === 100 && !imported) {
queryResultsProgressElement.classList.add("hide");
queryResultsUserFeedbackElement.classList.add("hide");
queryResultsExportElement.classList.remove("disabled");
addToSubResultsElement.removeAttribute("disabled");
// inital expert mode check and sub results activation
results.jsList.activateInspect();
if (addToSubResultsElement.checked) {
results.jsList.activateAddToSubResults();
}
if (expertModeSwitchElement.checked) {
results.jsList.expertModeOn("query-display");
}
} else if (imported) {
progress = 100;
results.jsList.activateInspect();
if (expertModeSwitchElement.checked) {
results.jsList.expertModeOn("query-display");
}
}
}

View File

@ -403,7 +403,6 @@ class ResultsList extends List {
}
helperCreateCpos(cpos_ranges, cpos_values) {
console.log(cpos_values);
let lc;
let c;
let rc;