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
9d918828
Commit
9d918828
authored
Jul 17, 2020
by
Coung Ngo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve labels_select.js code
Improve code as a result of reviewer feedback
parent
c4079d30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+5
-5
No files found.
app/assets/javascripts/labels_select.js
View file @
9d918828
...
...
@@ -3,7 +3,7 @@
/* global ListLabel */
import
$
from
'
jquery
'
;
import
{
difference
,
isEqual
,
escape
,
sortBy
,
template
}
from
'
lodash
'
;
import
{
difference
,
isEqual
,
escape
,
sortBy
,
template
,
union
}
from
'
lodash
'
;
import
{
sprintf
,
s__
,
__
}
from
'
./locale
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
...
...
@@ -560,15 +560,15 @@ export default class LabelsSelect {
IssuableBulkUpdateActions
.
willUpdateLabels
=
true
;
}
// eslint-disable-next-line class-methods-use-this
setDropdownData
(
$dropdown
,
is
Chec
king
,
labelId
)
{
setDropdownData
(
$dropdown
,
is
Mar
king
,
labelId
)
{
let
userCheckedIds
=
$dropdown
.
data
(
'
user-checked
'
)
||
[];
let
userUncheckedIds
=
$dropdown
.
data
(
'
user-unchecked
'
)
||
[];
if
(
is
Chec
king
)
{
userCheckedIds
=
u
serCheckedIds
.
concat
(
labelId
);
if
(
is
Mar
king
)
{
userCheckedIds
=
u
nion
(
userCheckedIds
,
[
labelId
]
);
userUncheckedIds
=
difference
(
userUncheckedIds
,
[
labelId
]);
}
else
{
userUncheckedIds
=
u
serUncheckedIds
.
concat
(
labelId
);
userUncheckedIds
=
u
nion
(
userUncheckedIds
,
[
labelId
]
);
userCheckedIds
=
difference
(
userCheckedIds
,
[
labelId
]);
}
...
...
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