navbar.js 300 B

1234567891011121314
  1. /**
  2. * Client code for the navbar template.
  3. *
  4. * - events
  5. */
  6. Template.navbar.events({
  7. "submit .js-search-form": function (event) {
  8. event.preventDefault();
  9. const search = $(event.target["search-term"]).val();
  10. // FIXME Prevent XSS and CSRF.
  11. Router.go("/search/" + search);
  12. }
  13. });