Refine facet behavior in the Topic demo MKWS-277
authorJason Skomorowski <jason@indexdata.com>
Tue, 7 Oct 2014 01:48:37 +0000 (21:48 -0400)
committerJason Skomorowski <jason@indexdata.com>
Tue, 7 Oct 2014 01:48:37 +0000 (21:48 -0400)
examples/htdocs/topic.html

index af4e1d6..ff88fb4 100644 (file)
@@ -34,6 +34,9 @@
         return mkws.getParameterByName('q', obj[0]);
       }
     });
+    Handlebars.registerHelper('mkws-topicurl', function(topic) {
+      return window.location.pathname + "?q=" + encodeURIComponent(topic);
+    });
   </script>
   <script class="mkwsTemplate_TopicImage" type="text/x-handlebars-template">
     {{#each hits}}
@@ -52,7 +55,7 @@
     {{#each terms}}
       <li class="list-group-item mkwsTerm">
         <span class="badge">{{count}}</span>
-        <a href="#" {{linkdata}}>{{term}}</a>
+        <a href="{{mkws-topicurl term}}">{{term}}</a>
       </li>
     {{/each}}
   </script>