From 1ed696f558e39c1c61c76cb49886da6d8308b30c Mon Sep 17 00:00:00 2001 From: Stephan Porada Date: Mon, 6 Apr 2020 12:52:26 +0200 Subject: [PATCH] Fix 2 --- app/static/js/nopaque.callbacks.js | 4 ++++ app/static/js/nopaque.pj_analyse_corpus.js | 2 -- app/templates/corpora/pj_analyse_corpus.html.j2 | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/static/js/nopaque.callbacks.js b/app/static/js/nopaque.callbacks.js index b6678a60..9ddc8dab 100644 --- a/app/static/js/nopaque.callbacks.js +++ b/app/static/js/nopaque.callbacks.js @@ -56,4 +56,8 @@ function queryRenderResults(payload) { queryResultsExportElement.classList.remove("disabled"); activateInspect(); } + if (expertModeSwitchElement) { + let initialTokenElements = document.getElementsByClassName("token"); + expertModeOn(initialTokenElements, resultsJSON); + } } \ No newline at end of file diff --git a/app/static/js/nopaque.pj_analyse_corpus.js b/app/static/js/nopaque.pj_analyse_corpus.js index 85517acd..b96d61d3 100644 --- a/app/static/js/nopaque.pj_analyse_corpus.js +++ b/app/static/js/nopaque.pj_analyse_corpus.js @@ -225,8 +225,6 @@ function expertModeOn(tokenElements, results) { let token; console.log("expertModeOn!"); - console.log(results); - console.log("hier:", tokenElements); for (let tokenElement of tokenElements) { tokenElement.classList.add("chip"); tokenElement.classList.add("hoverable"); diff --git a/app/templates/corpora/pj_analyse_corpus.html.j2 b/app/templates/corpora/pj_analyse_corpus.html.j2 index d021526c..d17620d4 100644 --- a/app/templates/corpora/pj_analyse_corpus.html.j2 +++ b/app/templates/corpora/pj_analyse_corpus.html.j2 @@ -280,6 +280,7 @@ receivedMatchCountElement = document.getElementById("received-match-count"); matchCountElement = document.getElementById("match-count"); textLookupCountElement = document.getElementById("text-lookup-count"); + var expertModeSwitchElement = document.getElementById("display-options-form-expert_mode"); document.addEventListener("DOMContentLoaded", () => { @@ -345,7 +346,6 @@ } // epxert mode table view - expertModeSwitchElement = document.getElementById("display-options-form-expert_mode"); expertModeSwitchElement.addEventListener("change", function(event) { let currentTokenElements = document.getElementsByClassName("token"); let paginationElements = document.getElementsByClassName("pagination");