Commit 9950dfb0 authored by leiminghuan's avatar leiminghuan

code prettier

parent 4472fd8d
...@@ -29,7 +29,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -29,7 +29,7 @@ function UsersSelect(currentUser, els, options = {}) {
const { handleClick } = options; const { handleClick } = options;
const userSelect = this; const userSelect = this;
$els.each( (i, dropdown) => { $els.each((i, dropdown) => {
const userSelect = this; const userSelect = this;
const options = {}; const options = {};
const $dropdown = $(dropdown); const $dropdown = $(dropdown);
...@@ -488,10 +488,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -488,10 +488,7 @@ function UsersSelect(currentUser, els, options = {}) {
// Automatically close dropdown after assignee is selected // Automatically close dropdown after assignee is selected
// since CE has no multiple assignees // since CE has no multiple assignees
// EE does not have a max-select // EE does not have a max-select
if ( if ($dropdown.data('maxSelect') && getSelected().length === $dropdown.data('maxSelect')) {
$dropdown.data('maxSelect') &&
getSelected().length === $dropdown.data('maxSelect')
) {
// Close the dropdown // Close the dropdown
$dropdown.dropdown('toggle'); $dropdown.dropdown('toggle');
} }
...@@ -557,8 +554,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -557,8 +554,7 @@ function UsersSelect(currentUser, els, options = {}) {
}); });
import(/* webpackChunkName: 'select2' */ 'select2/select2') import(/* webpackChunkName: 'select2' */ 'select2/select2')
.then(() => { .then(() => {
$('.ajax-users-select').each( $('.ajax-users-select').each((i, select) => {
(i, select) => {
const options = {}; const options = {};
options.skipLdap = $(select).hasClass('skip_ldap'); options.skipLdap = $(select).hasClass('skip_ldap');
options.projectId = $(select).data('projectId'); options.projectId = $(select).data('projectId');
...@@ -613,11 +609,7 @@ function UsersSelect(currentUser, els, options = {}) { ...@@ -613,11 +609,7 @@ function UsersSelect(currentUser, els, options = {}) {
data.results.unshift(anyUser); data.results.unshift(anyUser);
} }
} }
if ( if (showEmailUser && data.results.length === 0 && query.term.match(/^[^@]+@[^@]+$/)) {
showEmailUser &&
data.results.length === 0 &&
query.term.match(/^[^@]+@[^@]+$/)
) {
const trimmed = query.term.trim(); const trimmed = query.term.trim();
const emailUser = { const emailUser = {
name: sprintf(__('Invite "%{trimmed}" by email'), { trimmed }), name: sprintf(__('Invite "%{trimmed}" by email'), { trimmed }),
......
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