summaryrefslogtreecommitdiffstats
path: root/client/components/sidebar/sidebarSearches.js
blob: 8944c04e80e2bed51d12d3175e213a96a14cd401 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BlazeComponent.extendComponent({
  onCreated() {
    this.term = new ReactiveVar('');
  },

  results() {
    const currentBoard = Boards.findOne(Session.get('currentBoard'));
    return currentBoard.searchCards(this.term.get());
  },

  events() {
    return [
      {
        'submit .js-search-term-form'(evt) {
          evt.preventDefault();
          this.term.set(evt.target.searchTerm.value);
        },
      },
    ];
  },
}).register('searchSidebar');