From 39dc462114547a6e7f431f96898c93730f889165 Mon Sep 17 00:00:00 2001 From: Kai Lauterbach Date: Fri, 5 May 2023 10:41:41 +0200 Subject: [PATCH] Fixed tab switching --- firmware/data/bottom.js | 5 ++++- firmware/data/index_template_top.html | 17 +++++++++++++++++ firmware/data/style.css | 4 ++-- firmware/html/bottom.js | 6 +++++- firmware/html/index_template_top.html | 17 +++++++++++++++++ firmware/html/style.css | 4 ++-- 6 files changed, 47 insertions(+), 6 deletions(-) diff --git a/firmware/data/bottom.js b/firmware/data/bottom.js index fe6a7d6..e619d89 100644 --- a/firmware/data/bottom.js +++ b/firmware/data/bottom.js @@ -1,4 +1,5 @@ function addTabListener() { +console.log("Try to add tab listener"); try { var tabMain = document.getElementById("tab-lights"); var tabConfig = document.getElementById("tab-config"); @@ -7,6 +8,7 @@ var amain = document.getElementById("tab-a-lights"); var acfg = document.getElementById("tab-a-config"); var atde = document.getElementById("tab-a-tde"); amain.addEventListener("click", function() { +console.log("Switch to main lights tab"); tabMain.classList.add("visible"); tabConfig.classList.remove("visible"); tabTDE.classList.remove("visible"); @@ -15,6 +17,7 @@ acfg.classList.remove("pure-button-primary"); atde.classList.remove("pure-button-primary"); }); acfg.addEventListener("click", function() { +console.log("Switch to config tab"); tabMain.classList.remove("visible"); tabConfig.classList.add("visible"); tabTDE.classList.remove("visible"); @@ -23,13 +26,13 @@ acfg.classList.add("pure-button-primary"); atde.classList.remove("pure-button-primary"); }); atde.addEventListener("click", function() { +console.log("Switch to TDE tab"); tabMain.classList.remove("visible"); tabConfig.classList.remove("visible"); tabTDE.classList.add("visible"); amain.classList.remove("pure-button-primary"); acfg.classList.remove("pure-button-primary"); atde.classList.add("pure-button-primary"); -createTable(); }); } catch (error) { console.log("Error: load listener of the tab action listener management: " + error.message); diff --git a/firmware/data/index_template_top.html b/firmware/data/index_template_top.html index e12f53c..3c7bd96 100644 --- a/firmware/data/index_template_top.html +++ b/firmware/data/index_template_top.html @@ -9,6 +9,23 @@ + diff --git a/firmware/data/style.css b/firmware/data/style.css index e39a471..687ae93 100644 --- a/firmware/data/style.css +++ b/firmware/data/style.css @@ -1,4 +1,4 @@ -#tab-lights, #tab-config, #tab-tde { +/*#tab-lights, #tab-config, #tab-tde { display: none; background-color: #ffffff; color: black; @@ -40,4 +40,4 @@ cursor: pointer; } .pure-button:hover { background-color: #333; -} \ No newline at end of file +}*/ \ No newline at end of file diff --git a/firmware/html/bottom.js b/firmware/html/bottom.js index b3af045..b5e3b31 100644 --- a/firmware/html/bottom.js +++ b/firmware/html/bottom.js @@ -1,4 +1,5 @@ function addTabListener() { + console.log("Try to add tab listener"); try { var tabMain = document.getElementById("tab-lights"); var tabConfig = document.getElementById("tab-config"); @@ -10,6 +11,7 @@ function addTabListener() { amain.addEventListener("click", function() { + console.log("Switch to main lights tab"); tabMain.classList.add("visible"); tabConfig.classList.remove("visible"); tabTDE.classList.remove("visible"); @@ -20,6 +22,7 @@ function addTabListener() { }); acfg.addEventListener("click", function() { + console.log("Switch to config tab"); tabMain.classList.remove("visible"); tabConfig.classList.add("visible"); tabTDE.classList.remove("visible"); @@ -30,6 +33,7 @@ function addTabListener() { }); atde.addEventListener("click", function() { + console.log("Switch to TDE tab"); tabMain.classList.remove("visible"); tabConfig.classList.remove("visible"); tabTDE.classList.add("visible"); @@ -38,7 +42,7 @@ function addTabListener() { acfg.classList.remove("pure-button-primary"); atde.classList.add("pure-button-primary"); - createTable(); + //createTable(); // recreate the table on timing data editor tab }); } catch (error) { console.log("Error: load listener of the tab action listener management: " + error.message); diff --git a/firmware/html/index_template_top.html b/firmware/html/index_template_top.html index 6818214..511eecc 100644 --- a/firmware/html/index_template_top.html +++ b/firmware/html/index_template_top.html @@ -9,6 +9,23 @@ + diff --git a/firmware/html/style.css b/firmware/html/style.css index e39a471..687ae93 100644 --- a/firmware/html/style.css +++ b/firmware/html/style.css @@ -1,4 +1,4 @@ -#tab-lights, #tab-config, #tab-tde { +/*#tab-lights, #tab-config, #tab-tde { display: none; background-color: #ffffff; color: black; @@ -40,4 +40,4 @@ cursor: pointer; } .pure-button:hover { background-color: #333; -} \ No newline at end of file +}*/ \ No newline at end of file