From 1b0ec1c4bdcbf99873caf5ebe7035d13a8b2d6fc Mon Sep 17 00:00:00 2001 From: Robert Kaiser Date: Sun, 30 Dec 2012 22:01:27 +0100 Subject: [PATCH] switch main header when navigating through modules --- TODO | 2 +- js/tricorder.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TODO b/TODO index 79fe413..6da439a 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,7 @@ Tasks to complete for Web Tricorder: * Make more sensors work - see https://wiki.mozilla.org/WebAPI -** Networks (probably need ceritified app!) +** Networks (probably need certified app!) *** Current connection: http://dvcs.w3.org/hg/dap/raw-file/tip/network-api/Overview.html *** Mobile Networks: https://wiki.mozilla.org/WebAPI/WebMobileConnection *** WiFi Networks: http://groups.google.com/group/mozilla.dev.webapi/browse_thread/thread/ed980c42261c5f4a diff --git a/js/tricorder.js b/js/tricorder.js index 2debeec..093f517 100644 --- a/js/tricorder.js +++ b/js/tricorder.js @@ -74,8 +74,11 @@ function switchModule(modname) { navs[i].classList.remove("active"); } - document.getElementById("nav" + modname).classList.add("active"); + var navItem = document.getElementById("nav" + modname); + navItem.classList.add("active"); document.getElementById("sect" + modname).classList.add("active"); + document.getElementById("mainHeader").textContent = + (modname == "Other") ? "Web Tricorder" : navItem.textContent; window["gMod" + modname].activate(); } -- 2.35.3