Commit 713052c7 authored by Phil Hughes's avatar Phil Hughes

Merge branch '38869-labels' into 'master'

Export logo and labels select as ES6 modules

See merge request gitlab-org/gitlab-ce!15091
parents b6e69673 1fc4e2b6
/* eslint-disable comma-dangle, space-before-function-paren, no-new */
/* global MilestoneSelect */
/* global LabelsSelect */
/* global Sidebar */
import Vue from 'vue';
......@@ -11,6 +10,7 @@ import Assignees from '../../sidebar/components/assignees/assignees';
import DueDateSelectors from '../../due_date_select';
import './sidebar/remove_issue';
import IssuableContext from '../../issuable_context';
import LabelsSelect from '../../labels_select';
const Store = gl.issueBoards.BoardsStore;
......
......@@ -3,7 +3,7 @@
import IssuableIndex from './issuable_index';
/* global Milestone */
import IssuableForm from './issuable_form';
/* global LabelsSelect */
import LabelsSelect from './labels_select';
/* global MilestoneSelect */
/* global NewBranchForm */
/* global NotificationsForm */
......
/* eslint-disable no-new */
/* global MilestoneSelect */
/* global LabelsSelect */
import LabelsSelect from './labels_select';
import IssuableContext from './issuable_context';
/* global Sidebar */
......
/* eslint-disable no-new */
/* global LabelsSelect */
import LabelsSelect from './labels_select';
/* global MilestoneSelect */
/* global SubscriptionSelect */
......
/* eslint-disable class-methods-use-this, no-new */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global SubscriptionSelect */
......@@ -7,7 +6,7 @@ import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
import './milestone_select';
import issueStatusSelect from './issue_status_select';
import './subscription_select';
import './labels_select';
import LabelsSelect from './labels_select';
const HIDDEN_CLASS = 'hidden';
const DISABLED_CONTENT_CLASS = 'disabled-content';
......
......@@ -6,9 +6,8 @@ import IssuableBulkUpdateActions from './issuable_bulk_update_actions';
import DropdownUtils from './filtered_search/dropdown_utils';
import CreateLabelDropdown from './create_label';
(function() {
this.LabelsSelect = (function() {
function LabelsSelect(els) {
export default class LabelsSelect {
constructor(els) {
var _this, $els;
_this = this;
......@@ -408,22 +407,22 @@ import CreateLabelDropdown from './create_label';
this.bindEvents();
}
LabelsSelect.prototype.bindEvents = function() {
bindEvents() {
return $('body').on('change', '.selected_issue', this.onSelectCheckboxIssue);
};
LabelsSelect.prototype.onSelectCheckboxIssue = function() {
}
// eslint-disable-next-line class-methods-use-this
onSelectCheckboxIssue() {
if ($('.selected_issue:checked').length) {
return;
}
return $('.issues-bulk-update .labels-filter .dropdown-toggle-text').text('Label');
};
LabelsSelect.prototype.enableBulkLabelDropdown = function() {
}
// eslint-disable-next-line class-methods-use-this
enableBulkLabelDropdown() {
IssuableBulkUpdateActions.willUpdateLabels = true;
};
LabelsSelect.prototype.setDropdownData = function($dropdown, isMarking, value) {
}
// eslint-disable-next-line class-methods-use-this
setDropdownData($dropdown, isMarking, value) {
var i, markedIds, unmarkedIds, indeterminateIds;
markedIds = $dropdown.data('marked') || [];
......@@ -464,16 +463,13 @@ import CreateLabelDropdown from './create_label';
$dropdown.data('marked', markedIds);
$dropdown.data('unmarked', unmarkedIds);
$dropdown.data('indeterminate', indeterminateIds);
};
LabelsSelect.prototype.setOriginalDropdownData = function($container, $dropdown) {
var labels = [];
}
// eslint-disable-next-line class-methods-use-this
setOriginalDropdownData($container, $dropdown) {
const labels = [];
$container.find('[name="label_name[]"]').map(function() {
return labels.push(this.value);
});
$dropdown.data('marked', labels);
};
return LabelsSelect;
})();
}).call(window);
}
}
/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback */
(function() {
window.addEventListener('beforeunload', function() {
export default function initLogoAnimation() {
window.addEventListener('beforeunload', () => {
$('.tanuki-logo').addClass('animate');
});
}).call(window);
}
......@@ -55,11 +55,10 @@ import './gl_field_errors';
import './gl_form';
import initTodoToggle from './header';
import initImporterStatus from './importer_status';
import './labels_select';
import './layout_nav';
import LazyLoader from './lazy_loader';
import './line_highlighter';
import './logo';
import initLogoAnimation from './logo';
import './merge_request';
import './merge_request_tabs';
import './milestone';
......@@ -134,6 +133,7 @@ $(function () {
initBreadcrumbs();
initImporterStatus();
initTodoToggle();
initLogoAnimation();
// Set the default path for all cookies to GitLab's root directory
Cookies.defaults.path = gon.relative_url_root || '/';
......
/* eslint-disable no-new */
import IssuableContext from '~/issuable_context';
/* global LabelsSelect */
import LabelsSelect from '~/labels_select';
import '~/gl_dropdown';
import 'select2';
import '~/api';
import '~/create_label';
import '~/users_select';
import '~/labels_select';
(() => {
let saveLabelCount = 0;
......
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