Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9950dfb0
Commit
9950dfb0
authored
Dec 17, 2019
by
leiminghuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code prettier
parent
4472fd8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
91 deletions
+83
-91
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+83
-91
No files found.
app/assets/javascripts/users_select.js
View file @
9950dfb0
...
@@ -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
}),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment