2026-03-08 11:01:21 +02:00
|
|
|
Template.searchSidebar.onCreated(function () {
|
|
|
|
|
this.term = new ReactiveVar('');
|
|
|
|
|
});
|
2018-02-23 01:09:59 +01:00
|
|
|
|
2026-03-08 11:01:21 +02:00
|
|
|
Template.searchSidebar.helpers({
|
2021-10-21 13:16:51 +02:00
|
|
|
cards() {
|
2022-12-15 22:26:08 +01:00
|
|
|
const currentBoard = Utils.getCurrentBoard();
|
2026-03-08 11:01:21 +02:00
|
|
|
return currentBoard.searchCards(Template.instance().term.get());
|
2018-02-23 01:09:59 +01:00
|
|
|
},
|
|
|
|
|
|
2019-10-29 19:05:44 +02:00
|
|
|
lists() {
|
2022-12-15 22:26:08 +01:00
|
|
|
const currentBoard = Utils.getCurrentBoard();
|
2026-03-08 11:01:21 +02:00
|
|
|
return currentBoard.searchLists(Template.instance().term.get());
|
2019-10-29 19:05:44 +02:00
|
|
|
},
|
2026-03-08 11:01:21 +02:00
|
|
|
});
|
2019-10-29 19:05:44 +02:00
|
|
|
|
2026-03-08 11:01:21 +02:00
|
|
|
Template.searchSidebar.events({
|
|
|
|
|
'click .js-minicard'(evt) {
|
2026-02-08 00:48:39 +02:00
|
|
|
if (Utils.isMiniScreen()) {
|
|
|
|
|
evt.preventDefault();
|
2026-03-08 11:01:21 +02:00
|
|
|
Session.set('popupCardId', Template.currentData()._id);
|
|
|
|
|
if (!Popup.isOpen()) {
|
|
|
|
|
Popup.open("cardDetails")(evt);
|
|
|
|
|
}
|
2026-02-08 00:48:39 +02:00
|
|
|
}
|
2021-10-21 13:16:51 +02:00
|
|
|
},
|
2026-03-08 11:01:21 +02:00
|
|
|
'submit .js-search-term-form'(evt, tpl) {
|
|
|
|
|
evt.preventDefault();
|
|
|
|
|
tpl.term.set(evt.target.searchTerm.value);
|
2018-02-23 01:09:59 +01:00
|
|
|
},
|
2026-03-08 11:01:21 +02:00
|
|
|
});
|