on first page, hide the termlist and start displaying it after results are back
authorWolfram Schneider <wosch@indexdata.dk>
Mon, 1 Jul 2013 13:15:39 +0000 (13:15 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Mon, 1 Jul 2013 13:15:39 +0000 (13:15 +0000)
experiments/spclient/index-mobile.html
experiments/spclient/mkws.js

index 7fc9924..e73267b 100644 (file)
@@ -18,7 +18,7 @@
                sort_default: "relevance",
                query_width: 50,
                responsive_design: true,
-               facets: ["sources", "subjects", "authors"],
+               facets: ["authors", "sources", "subjects"],
                perpage_default: 20
         }; 
     </script>
index ae807e1..d168a34 100644 (file)
@@ -158,8 +158,14 @@ function my_onstat(data) {
 }
 
 function my_onterm(data) {
-    if (!mkws_config.facets || mkws_config.facets.length == 0)
+    // no facets
+    if (!mkws_config.facets || mkws_config.facets.length == 0) {
+       $("#termlist").parent().hide();
        return;
+    }
+
+    // display if we first got results
+    $("#termlist").parent().show();
 
     var termlists = [];
     termlists.push('<div class="title">' + M('Termlists') + '</div>');
@@ -558,6 +564,9 @@ function mkws_html_all(config) {
        mkws_service_proxy_auth(config.service_proxy_auth);
 
     domReady();
+
+    // on first page, hide the termlist
+    $(document).ready(function() { $("#termlist").parent().hide(); } );
 }
 
 function mkws_set_lang(mkws_config)  {