2018-02-23 01:09:59 +01:00
|
|
|
BlazeComponent.extendComponent({
|
|
|
|
|
onCreated() {
|
|
|
|
|
this.term = new ReactiveVar('');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
results() {
|
|
|
|
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
|
|
|
|
return currentBoard.searchCards(this.term.get());
|
|
|
|
|
},
|
|
|
|
|
|
2019-10-29 19:05:44 +02:00
|
|
|
lists() {
|
|
|
|
|
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
|
|
|
|
return currentBoard.searchLists(this.term.get());
|
|
|
|
|
},
|
|
|
|
|
|
2018-02-23 01:09:59 +01:00
|
|
|
events() {
|
2019-06-28 12:52:09 -05:00
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
'submit .js-search-term-form'(evt) {
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
this.term.set(evt.target.searchTerm.value);
|
|
|
|
|
},
|
2018-02-23 01:09:59 +01:00
|
|
|
},
|
2019-06-28 12:52:09 -05:00
|
|
|
];
|
2018-02-23 01:09:59 +01:00
|
|
|
},
|
|
|
|
|
}).register('searchSidebar');
|