resultCard.js 741 B

1234567891011121314151617181920212223242526272829303132333435
  1. Template.resultCard.helpers({
  2. userId() {
  3. return Meteor.userId();
  4. },
  5. });
  6. BlazeComponent.extendComponent({
  7. clickOnMiniCard(evt) {
  8. evt.preventDefault();
  9. const this_ = this;
  10. const cardId = this.currentData()._id;
  11. const boardId = this.currentData().boardId;
  12. Meteor.subscribe('popupCardData', cardId, {
  13. onReady() {
  14. Session.set('popupCardId', cardId);
  15. Session.set('popupCardBoardId', boardId);
  16. this_.cardDetailsPopup(evt);
  17. },
  18. });
  19. },
  20. cardDetailsPopup(event) {
  21. if (!Popup.isOpen()) {
  22. Popup.open("cardDetails")(event);
  23. }
  24. },
  25. events() {
  26. return [
  27. {
  28. 'click .js-minicard': this.clickOnMiniCard,
  29. },
  30. ];
  31. },
  32. }).register('resultCard');