don't not init mkws_debug, this will be done later by the widget app, MKWS-27
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index e2e3ccf..f4e9646 100644 (file)
@@ -16,7 +16,8 @@ if (!mkws_config)
 if (typeof mkws_config.use_service_proxy === 'undefined')
     mkws_config.use_service_proxy = true;
 
-var mkws_debug = 1;
+// global debug flag
+var mkws_debug;
 
 var pazpar2_url = mkws_config.pazpar2_url ? mkws_config.pazpar2_url : "/pazpar2/search.pz2";
 var service_proxy_url = mkws_config.service_proxy_url ? mkws_config.service_proxy_url : "http://mkws.indexdata.com/service-proxy/";
@@ -160,12 +161,12 @@ function my_onstat(data) {
 function my_onterm(data) {
     // no facets
     if (!mkws_config.facets || mkws_config.facets.length == 0) {
-       $("#mkwsTermlists").parent().hide();
+       $("#mkwsTermlists").hide();
        return;
     }
 
     // display if we first got results
-    $("#mkwsTermlists").parent().show();
+    $("#mkwsTermlists").show();
 
     var acc = [];
     acc.push('<div class="title">' + M('Termlists') + '</div>');
@@ -602,7 +603,7 @@ function mkws_html_all(config) {
     domReady();
 
     // on first page, hide the termlist
-    $(document).ready(function() { $("#mkwsTermlists").parent().hide(); } );
+    $(document).ready(function() { $("#mkwsTermlists").hide(); } );
 }
 
 /* Responsive web design - change layout on the fly depending on
@@ -778,14 +779,14 @@ function mkws_mobile_resize () {
            $("#" + list[i]).hide();
        }
 
-       $("#mkwsTermlists").parent().hide();
-       obj = $("#mkwsTermlists").parent().html();
+       $("#mkwsTermlists").hide();
+       obj = $("#mkwsTermlists").html();
         $("#mkwsShiftedTermlists").html(obj);
     } else {
        for(var i = 0; i < list.length; i++) {
            $("#" + list[i]).show();
        }
-       $("#mkwsTermlists").parent().show();
+       $("#mkwsTermlists").show();
        $("#mkwsShiftedTermlists").html("");
     }
 };