minicard.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Template.cards.events({
  2. // 'click .member': Popup.open('cardMember')
  3. // });
  4. BlazeComponent.extendComponent({
  5. template() {
  6. return 'minicard';
  7. },
  8. events() {
  9. return [
  10. {
  11. 'click .js-linked-link'() {
  12. if (this.data().isLinkedCard()) Utils.goCardId(this.data().linkedId);
  13. else if (this.data().isLinkedBoard())
  14. Utils.goBoardId(this.data().linkedId);
  15. },
  16. },
  17. {
  18. 'click .js-toggle-minicard-label-text'() {
  19. import { Cookies } from 'meteor/ostrio:cookies';
  20. const cookies = new Cookies();
  21. if (cookies.has('hiddenMinicardLabelText')) {
  22. cookies.remove('hiddenMinicardLabelText'); //true
  23. } else {
  24. cookies.set('hiddenMinicardLabelText', 'true'); //true
  25. }
  26. },
  27. },
  28. ];
  29. },
  30. }).register('minicard');
  31. Template.minicard.helpers({
  32. showDesktopDragHandles() {
  33. currentUser = Meteor.user();
  34. if (currentUser) {
  35. return (currentUser.profile || {}).showDesktopDragHandles;
  36. } else {
  37. import { Cookies } from 'meteor/ostrio:cookies';
  38. const cookies = new Cookies();
  39. if (cookies.has('showDesktopDragHandles')) {
  40. return true;
  41. } else {
  42. return false;
  43. }
  44. }
  45. },
  46. hiddenMinicardLabelText() {
  47. currentUser = Meteor.user();
  48. if (currentUser) {
  49. return (currentUser.profile || {}).hiddenMinicardLabelText;
  50. } else {
  51. import { Cookies } from 'meteor/ostrio:cookies';
  52. const cookies = new Cookies();
  53. if (cookies.has('hiddenMinicardLabelText')) {
  54. return true;
  55. } else {
  56. return false;
  57. }
  58. }
  59. },
  60. });