From 400f8f4e8a1da22f2796da885a8ac4b891f02b67 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Fri, 5 Jul 2013 17:27:19 +0100 Subject: [PATCH] Much simpler switchView() code, what a dummy I was. Fixes bug MKWS-30 --- experiments/spclient/mkws.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index bdba531..4c75a8c 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -398,36 +398,24 @@ function pagerPrev() { function switchView(view) { var targets = document.getElementById('mkwsTargets'); - var results = document.getElementById('mkwsResults'); - var records = document.getElementById('mkwsRecords'); + var results = document.getElementById('mkwsResults') || + document.getElementById('mkwsRecords'); var blanket = document.getElementById('mkwsBlanket'); switch(view) { case 'targets': if (targets) targets.style.display = "block"; - if (results) { - results.style.display = "none"; - } else { - records.style.display = "none"; - } + if (results) results.style.display = "none"; if (blanket) blanket.style.display = "none"; break; case 'records': if (targets) targets.style.display = "none"; - if (results) { - results.style.display = "block"; - } else { - records.style.display = "block"; - } + if (results) results.style.display = "block"; if (blanket) blanket.style.display = "block"; break; case 'none': if (targets) targets.style.display = "none"; - if (results) { - results.style.display = "none"; - } else { - records.style.display = "none"; - } + if (results) results.style.display = "none"; if (blanket) blanket.style.display = "none"; break; default: -- 1.7.10.4