delayed debug message for jquery plugin
authorWolfram Schneider <wosch@indexdata.dk>
Wed, 10 Jul 2013 12:54:02 +0000 (12:54 +0000)
committerWolfram Schneider <wosch@indexdata.dk>
Wed, 10 Jul 2013 12:54:02 +0000 (12:54 +0000)
tools/htdocs/mkws.js

index 47db28d..bcb3435 100644 (file)
@@ -834,6 +834,10 @@ jQuery.extend({
     return nvpair;
   },
 
+    debug2: function(string) { // delayed debug
+       setTimeout(function() { debug(string); }, 500);
+    },
+
   // service-proxy or pazpar2
   pazpar2: function(config) {
 
@@ -894,12 +898,12 @@ jQuery.extend({
       </tr>\
     </table>';
 
-    if (config && config.layout == 'table') {
-       debug("jquery plugin layout: table");
-        document.write(table);
-    } else {
-       debug("jquery plugin layout: div");
+    if (config && config.layout == 'div') {
+       this.debug2("jquery plugin layout: div");
         document.write(div);
+    } else {
+       this.debug2("jquery plugin layout: table");
+        document.write(table);
     }
 
   }
@@ -922,5 +926,6 @@ function debug(string) {
     console.log(string);
 }
 
+
 /* magic */
 $(document).ready(function() { mkws_html_all(mkws_config) });