Commit f7160499 authored by Clement Ho's avatar Clement Ho

Code improvements

parent d08610c3
...@@ -482,13 +482,15 @@ import Activities from './activities'; ...@@ -482,13 +482,15 @@ import Activities from './activities';
break; break;
case 'groups:labels:new': case 'groups:labels:new':
case 'groups:labels:edit': case 'groups:labels:edit':
new Labels();
break;
case 'projects:labels:new': case 'projects:labels:new':
import('./pages/projects/labels/new') import('./pages/projects/labels/new')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
case 'projects:labels:edit': case 'projects:labels:edit':
import('./pages/projects/labels/new') import('./pages/projects/labels/edit')
.then(callDefault) .then(callDefault)
.catch(fail); .catch(fail);
break; break;
......
import Labels from '~/labels'; import Labels from '~/labels';
export default function () { export default () => new Labels();
new Labels(); // eslint-disable-line no-new
}
/* eslint-disable no-new */
import LabelManager from '~/label_manager'; import LabelManager from '~/label_manager';
import GroupLabelSubscription from '~/group_label_subscription'; import GroupLabelSubscription from '~/group_label_subscription';
import ProjectLabelSubscription from '~/project_label_subscription'; import ProjectLabelSubscription from '~/project_label_subscription';
export default () => { export default () => {
if ($('.prioritized-labels').length) { if ($('.prioritized-labels').length) {
new LabelManager(); new LabelManager(); // eslint-disable-line no-new
} }
$('.label-subscription').each((i, el) => { $('.label-subscription').each((i, el) => {
const $el = $(el); const $el = $(el);
if ($el.find('.dropdown-group-label').length) { if ($el.find('.dropdown-group-label').length) {
new GroupLabelSubscription($el); new GroupLabelSubscription($el); // eslint-disable-line no-new
} else { } else {
new ProjectLabelSubscription($el); new ProjectLabelSubscription($el); // eslint-disable-line no-new
} }
}); });
}; };
import Labels from '~/labels'; import Labels from '~/labels';
export default function () { export default () => new Labels();
new Labels(); // eslint-disable-line no-new
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment