From: Wolfram Schneider Date: Mon, 1 Jul 2013 13:15:39 +0000 (+0000) Subject: on first page, hide the termlist and start displaying it after results are back X-Git-Tag: 0.9.1~396^2~3 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=4c6f9a1f806b78e332cd5712d37f72f20ac79567 on first page, hide the termlist and start displaying it after results are back --- diff --git a/experiments/spclient/index-mobile.html b/experiments/spclient/index-mobile.html index 7fc9924..e73267b 100644 --- a/experiments/spclient/index-mobile.html +++ b/experiments/spclient/index-mobile.html @@ -18,7 +18,7 @@ sort_default: "relevance", query_width: 50, responsive_design: true, - facets: ["sources", "subjects", "authors"], + facets: ["authors", "sources", "subjects"], perpage_default: 20 }; diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index ae807e1..d168a34 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -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('
' + M('Termlists') + '
'); @@ -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) {