mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Board search open the minicard as Popup
This commit is contained in:
parent
b9250e4be4
commit
4936e580fd
2 changed files with 19 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue