summaryrefslogtreecommitdiffstats
path: root/client/components/rules/rulesActions.js
blob: ecba857b72e69da3c8e1a57dd451b94a8527eecb (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
53
54
55
56
57
58
BlazeComponent.extendComponent({
  onCreated() {
    this.currentActions = new ReactiveVar('board');
  },

  setBoardActions() {
    this.currentActions.set('board');
    $('.js-set-card-actions').removeClass('active');
    $('.js-set-board-actions').addClass('active');
    $('.js-set-checklist-actions').removeClass('active');
    $('.js-set-mail-actions').removeClass('active');
  },
  setCardActions() {
    this.currentActions.set('card');
    $('.js-set-card-actions').addClass('active');
    $('.js-set-board-actions').removeClass('active');
    $('.js-set-checklist-actions').removeClass('active');
    $('.js-set-mail-actions').removeClass('active');
  },
  setChecklistActions() {
    this.currentActions.set('checklist');
    $('.js-set-card-actions').removeClass('active');
    $('.js-set-board-actions').removeClass('active');
    $('.js-set-checklist-actions').addClass('active');
    $('.js-set-mail-actions').removeClass('active');
  },
  setMailActions() {
    this.currentActions.set('mail');
    $('.js-set-card-actions').removeClass('active');
    $('.js-set-board-actions').removeClass('active');
    $('.js-set-checklist-actions').removeClass('active');
    $('.js-set-mail-actions').addClass('active');
  },

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

  name() {
    // console.log(this.data());
  },
  events() {
    return [{
      'click .js-set-board-actions' (event) {
        this.setBoardActions();
      },
      'click .js-set-card-actions' (event) {
        this.setCardActions();
      },
      'click .js-set-mail-actions' (event) {
        this.setMailActions();
      },
      'click .js-set-checklist-actions' (event) {
        this.setChecklistActions();
      },
    }];
  },
}).register('rulesActions');