w2v-js: fix onclick bindings for collocators
diff --git a/templates/index.html.ep b/templates/index.html.ep
index 32be0a8..9b6f69c 100644
--- a/templates/index.html.ep
+++ b/templates/index.html.ep
@@ -181,6 +181,11 @@
                return JSON.stringify(paraResults[0][0].rank);
              }
            },
+           "initComplete":function(settings, json){
+             $("td.collocator").click(function(){
+               queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
+             });
+           },
            "sScrollY": "780px",
            "bScrollCollapse": true,
            "bPaginate": false,
@@ -210,6 +215,10 @@
            "order": [[ 1, 'desc' ]],
          });
 
+         $("td.collocator").click(function(){
+           queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
+         });
+
          collocatorTable.on( 'order.dt search.dt', function () {
            collocatorTable.column(0, {order:'applied'}).nodes().each( function (cell, i) {
              cell.innerHTML = i+1;
@@ -245,12 +254,6 @@
      });
 
      $(function(){
-       $("td.collocator").click(function(){
-         queryKorAPCII(this.textContent + " /w5 " + CIIsearchWords);
-       });
-     });
-
-     $(function(){
        $("#showoptions").click(function(){
          $("#dropdownoptions").dialog("open");
          var target = $(this);