In switchView(), when there is no #mkwsResults (because the
authorMike Taylor <mike@indexdata.com>
Fri, 5 Jul 2013 16:23:43 +0000 (17:23 +0100)
committerMike Taylor <mike@indexdata.com>
Fri, 5 Jul 2013 16:23:43 +0000 (17:23 +0100)
application uses low-level components) turn #mkwsRecords on and off
instead.

experiments/spclient/mkws.js

index 92fbfd0..bdba531 100644 (file)
@@ -399,26 +399,39 @@ function pagerPrev() {
 function switchView(view) {
     var targets = document.getElementById('mkwsTargets');
     var results = document.getElementById('mkwsResults');
+    var records = document.getElementById('mkwsRecords');
     var blanket = document.getElementById('mkwsBlanket');
 
     switch(view) {
         case 'targets':
             if (targets) targets.style.display = "block";
-            if (results) results.style.display = "none";
+            if (results) {
+               results.style.display = "none";
+           } else {
+               records.style.display = "none";
+           }
             if (blanket) blanket.style.display = "none";
             break;
-        case 'results':
+        case 'records':
             if (targets) targets.style.display = "none";
-            if (results) results.style.display = "block";
+            if (results) {
+               results.style.display = "block";
+           } else {
+               records.style.display = "block";
+           }
             if (blanket) blanket.style.display = "block";
             break;
        case 'none':
             if (targets) targets.style.display = "none";
-            if (results) results.style.display = "none";
+            if (results) {
+               results.style.display = "none";
+           } else {
+               records.style.display = "none";
+           }
             if (blanket) blanket.style.display = "none";
             break;
         default:
-            alert('Unknown view.');
+            alert("Unknown view '" + view + "'");
     }
 }