summaryrefslogtreecommitdiffstats
path: root/client/components/rules/rulesActions.js
blob: 297fc806cddcb7f123dccb458231af731fa20758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
BlazeComponent.extendComponent({
  onCreated() {
    this.showBoardActions = new ReactiveVar(true);
    this.showCardActions = new ReactiveVar(false);
    this.showChecklistAction = new ReactiveVar(false);
  },


  setBoardTriggers(){
    this.showBoardActions.set(true);
    this.showCardActions.set(false);
    this.showChecklistActionsr.set(false);
    $('.js-set-card-triggers').removeClass('active');
    $('.js-set-board-triggers').addClass('active');
    $('.js-set-checklist-triggers').removeClass('active');
  },
  setCardTriggers(){
    this.showBoardActions.set(false);
    this.showCardActions.set(true);
    this.showChecklistActions.set(false);
    $('.js-set-card-triggers').addClass('active');
    $('.js-set-board-triggers').removeClass('active');
    $('.js-set-checklist-triggers').removeClass('active');
  },
  setChecklistTriggers(){
    this.showBoardActions.set(false);
    this.showCardActions.set(false);
    this.showChecklistActions.set(true);
    $('.js-set-card-triggers').removeClass('active');
    $('.js-set-board-triggers').removeClass('active');
    $('.js-set-checklist-triggers').addClass('active');
  },

  rules() {
    return Rules.find({});
  },

  name(){
    console.log(this.data());
  },
  events() {
    return [{'click .js-set-board-triggers'(event) {
      this.setBoardTriggers();
    },
    'click .js-set-card-triggers'(event) {
      this.setCardTriggers();
    },
    'click .js-set-checklist-triggers'(event) {
      this.setChecklistTriggers();
    },}];
  },
}).register('rulesActions');