diff --git a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js index 55d9beb4..891e12f7 100644 --- a/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js +++ b/app/static/js/CorpusAnalysis/CorpusAnalysisConcordance.js @@ -32,7 +32,9 @@ class CorpusAnalysisConcordance { async submitForm() { this.app.disableActionElements(); - let query = this.elements.form.query.value.trim(); + // let query = this.elements.form.query.value.trim(); + let query = this.checkQueryInput(); + console.log(query); let subcorpusName = this.elements.form['subcorpus-name'].value; this.elements.error.innerText = ''; this.elements.error.classList.add('hide'); @@ -96,6 +98,14 @@ class CorpusAnalysisConcordance { }); } + checkQueryInput() { + if (document.querySelector('#corpus-analysis-concordance-expert-mode-display').classList.contains('hide')) { + return document.querySelector('#corpus-analysis-concordance-query-preview').innerHTML.trim(); + } else { + return this.elements.form.query.value.trim(); + } + } + clearSubcorpusList() { this.elements.subcorpusList.innerHTML = ''; this.elements.subcorpusList.classList.add('hide'); diff --git a/app/templates/corpora/_analysis/concordance.html.j2 b/app/templates/corpora/_analysis/concordance.html.j2 index 5d14cce7..96c7ef8d 100644 --- a/app/templates/corpora/_analysis/concordance.html.j2 +++ b/app/templates/corpora/_analysis/concordance.html.j2 @@ -17,7 +17,7 @@