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
10ba2def
Commit
10ba2def
authored
May 02, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eslint
parent
445f8afc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+4
-6
No files found.
app/assets/javascripts/users_select.js
View file @
10ba2def
...
@@ -52,7 +52,6 @@ import eventHub from './sidebar/event_hub';
...
@@ -52,7 +52,6 @@ import eventHub from './sidebar/event_hub';
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$collapsedSidebar
=
$block
.
find
(
'
.sidebar-collapsed-user
'
);
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
$loading
=
$block
.
find
(
'
.block-loading
'
).
fadeOut
();
const
assignYourself
=
function
()
{
const
assignYourself
=
function
()
{
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
const
unassignedSelected
=
$dropdown
.
closest
(
'
.selectbox
'
)
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field-name
'
)}
'][value=0]`
);
.
find
(
`input[name='
${
$dropdown
.
data
(
'
field-name
'
)}
'][value=0]`
);
...
@@ -76,7 +75,7 @@ import eventHub from './sidebar/event_hub';
...
@@ -76,7 +75,7 @@ import eventHub from './sidebar/event_hub';
}
}
$dropdown
.
before
(
input
);
$dropdown
.
before
(
input
);
}
}
;
if
(
$block
[
0
])
{
if
(
$block
[
0
])
{
$block
[
0
].
addEventListener
(
'
assignYourself
'
,
assignYourself
);
$block
[
0
].
addEventListener
(
'
assignYourself
'
,
assignYourself
);
...
@@ -85,7 +84,7 @@ import eventHub from './sidebar/event_hub';
...
@@ -85,7 +84,7 @@ import eventHub from './sidebar/event_hub';
const
getSelectedUserInputs
=
function
()
{
const
getSelectedUserInputs
=
function
()
{
return
$selectbox
return
$selectbox
.
find
(
`input[name="
${
$dropdown
.
data
(
'
field-name
'
)}
"]`
);
.
find
(
`input[name="
${
$dropdown
.
data
(
'
field-name
'
)}
"]`
);
}
}
;
const
getSelected
=
function
()
{
const
getSelected
=
function
()
{
return
getSelectedUserInputs
()
return
getSelectedUserInputs
()
...
@@ -110,12 +109,12 @@ import eventHub from './sidebar/event_hub';
...
@@ -110,12 +109,12 @@ import eventHub from './sidebar/event_hub';
}
else
if
(
selectedUsers
.
length
===
1
)
{
}
else
if
(
selectedUsers
.
length
===
1
)
{
return
firstUser
.
name
;
return
firstUser
.
name
;
}
else
if
(
isSelected
)
{
}
else
if
(
isSelected
)
{
le
t
otherSelected
=
selectedUsers
.
filter
(
s
=>
s
!==
selectedUser
.
id
);
cons
t
otherSelected
=
selectedUsers
.
filter
(
s
=>
s
!==
selectedUser
.
id
);
return
`
${
selectedUser
.
name
}
+
${
otherSelected
.
length
}
more`
;
return
`
${
selectedUser
.
name
}
+
${
otherSelected
.
length
}
more`
;
}
else
{
}
else
{
return
`
${
firstUser
.
name
}
+
${
selectedUsers
.
length
-
1
}
more`
;
return
`
${
firstUser
.
name
}
+
${
selectedUsers
.
length
-
1
}
more`
;
}
}
}
}
;
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
(
e
)
=>
{
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
...
@@ -309,7 +308,6 @@ import eventHub from './sidebar/event_hub';
...
@@ -309,7 +308,6 @@ import eventHub from './sidebar/event_hub';
eventHub
.
$emit
(
'
sidebar.saveAssignees
'
);
eventHub
.
$emit
(
'
sidebar.saveAssignees
'
);
}
}
if
(
!
$dropdown
.
data
(
'
always-show-selectbox
'
))
{
if
(
!
$dropdown
.
data
(
'
always-show-selectbox
'
))
{
$selectbox
.
hide
();
$selectbox
.
hide
();
...
...
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