diff --git a/web/app/static/js/modules/corpus_analysis/client/Client.js b/web/app/static/js/modules/corpus_analysis/client/Client.js index 496749bb..7aac251d 100644 --- a/web/app/static/js/modules/corpus_analysis/client/Client.js +++ b/web/app/static/js/modules/corpus_analysis/client/Client.js @@ -122,6 +122,16 @@ class Client { getResultsData(resultsType, dataIndexes, results) { let tmp_first_cpos = []; let tmp_last_cpos = []; + let objectKey = ''; + if (resultsType === 'full-results') { + objectKey = 'fullResultsData'; + } else if (resultsType === 'sub-results') { + objectKey = 'subResultsData'; + } else if (resultsType = 'inspect-results') { + objectKey = 'inspectResultsData'; + } + // Delete old data before new data is coming in. + results[objectKey].init(); for (let dataIndex of dataIndexes) { tmp_first_cpos.push(results.data.matches[dataIndex].c[0]); tmp_last_cpos.push(results.data.matches[dataIndex].c[1]); diff --git a/web/app/static/js/modules/corpus_analysis/client/callbacks.js b/web/app/static/js/modules/corpus_analysis/client/callbacks.js index 445e4df3..2eaddb9d 100644 --- a/web/app/static/js/modules/corpus_analysis/client/callbacks.js +++ b/web/app/static/js/modules/corpus_analysis/client/callbacks.js @@ -90,7 +90,7 @@ function getResultsData() { } /** - * Handles incoming results whcih have been requestes via getResultsData(). and + * Handles incoming results which have been requested via getResultsData(). and * saves the data accorindgly into the results object. */ function saveResultsData() { @@ -103,7 +103,7 @@ function saveResultsData() { console.info('Saving sub-results data.'); objectKey = 'subResultsData'; } else if (type = 'inspect-results') { - objectKey = 'inspectResultsData' + objectKey = 'inspectResultsData'; console.info('Saving inspect-results data'); } // Save incoming data. Data is incoming one match at a time. diff --git a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js index 5f6b8830..b1378831 100644 --- a/web/app/static/js/modules/corpus_analysis/view/ResultsView.js +++ b/web/app/static/js/modules/corpus_analysis/view/ResultsView.js @@ -327,7 +327,14 @@ class ResultsList extends List { ]); // Clear fields from old data on every new inspect() call. this.contextId = dataIndex[0]; - this.contextResults.innerHTML = ""; + this.contextResults.innerHTML = ''; + // Open modal. + this.contextModal.open(); + this.contextResults.insertAdjacentHTML('afterbegin', ` +