Board search open the minicard as Popup

This commit is contained in:
Martin Filser 2021-10-21 13:16:51 +02:00
parent b9250e4be4
commit 4936e580fd
2 changed files with 19 additions and 2 deletions

View file

@ -3,10 +3,14 @@ template(name="searchSidebar")
input(type="text" name="searchTerm" placeholder="{{_ 'search-example'}}" autofocus dir="auto")
.list-body
.minilists.clearfix.js-minilists
hr
{{_ 'lists' }}
each (lists)
a.minilist-wrapper.js-minilist(href=originRelativeUrl)
+minilist(this)
.minicards.clearfix.js-minicards
each (results)
hr
{{_ 'cards' }}
each (cards)
a.minicard-wrapper.js-minicard(href=originRelativeUrl)
+minicard(this)

View file

@ -3,7 +3,7 @@ BlazeComponent.extendComponent({
this.term = new ReactiveVar('');
},
results() {
cards() {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
return currentBoard.searchCards(this.term.get());
},
@ -13,9 +13,22 @@ BlazeComponent.extendComponent({
return currentBoard.searchLists(this.term.get());
},
clickOnMiniCard(evt) {
evt.preventDefault();
Session.set('popupCard', this.currentData()._id);
this.cardDetailsPopup(evt);
},
cardDetailsPopup(event) {
if (!Popup.isOpen()) {
Popup.open("cardDetails")(event);
}
},
events() {
return [
{
'click .js-minicard': this.clickOnMiniCard,
'submit .js-search-term-form'(evt) {
evt.preventDefault();
this.term.set(evt.target.searchTerm.value);