From: Robert Kaiser Date: Sun, 30 Dec 2012 21:01:27 +0000 (+0100) Subject: switch main header when navigating through modules X-Git-Tag: production~24 X-Git-Url: https://git-public.kairo.at/?p=tricorder.git;a=commitdiff_plain;h=1b0ec1c4bdcbf99873caf5ebe7035d13a8b2d6fc switch main header when navigating through modules --- 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(); }