summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/init_labels.js
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-01-12 12:48:28 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-01-12 12:48:28 -0600
commitd85f72b10bfbaf202ae3329509b45b82362f2ec6 (patch)
treed03e08a6bf2731fd8dd651a1d6890d66189f1081 /app/assets/javascripts/init_labels.js
parent8a49e97bebb57eb763533b32e968547f37fa659e (diff)
downloadgitlab-ce-d85f72b10bfbaf202ae3329509b45b82362f2ec6.tar.gz
Refactor into init_labelsprojects-l
Diffstat (limited to 'app/assets/javascripts/init_labels.js')
-rw-r--r--app/assets/javascripts/init_labels.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/assets/javascripts/init_labels.js b/app/assets/javascripts/init_labels.js
new file mode 100644
index 00000000000..5f20055510f
--- /dev/null
+++ b/app/assets/javascripts/init_labels.js
@@ -0,0 +1,18 @@
+import LabelManager from './label_manager';
+import GroupLabelSubscription from './group_label_subscription';
+import ProjectLabelSubscription from './project_label_subscription';
+
+export default () => {
+ 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
+ }
+ });
+};