summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/init_labels.js
blob: d955b8cab10c96688888ddd5471827240083a678 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import $ from 'jquery';
import LabelManager from './label_manager';
import GroupLabelSubscription from './group_label_subscription';
import ProjectLabelSubscription from './project_label_subscription';

export default () => {
  debugger
  if ($('.prioritized-labels').length) {
    new LabelManager(); // eslint-disable-line no-new
  }
  $('.label-subscription').each((i, el) => {
    const $el = $(el);

    if ($el.find('.dropdown-group-label').length) {
      new GroupLabelSubscription($el); // eslint-disable-line no-new
    } else {
      new ProjectLabelSubscription($el); // eslint-disable-line no-new
    }
  });
};