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
1067010e
Commit
1067010e
authored
Aug 21, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary reference to `this`
parent
be3264dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
ee/app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
...ts/protected_branches/protected_branch_access_dropdown.js
+9
-10
No files found.
ee/app/assets/javascripts/protected_branches/protected_branch_access_dropdown.js
View file @
1067010e
...
...
@@ -30,7 +30,6 @@ export default class ProtectedBranchAccessDropdown {
}
initDropdown
()
{
const
self
=
this
;
const
{
onSelect
,
onHide
}
=
this
.
options
;
this
.
$dropdown
.
glDropdown
({
data
:
this
.
getData
.
bind
(
this
),
...
...
@@ -52,21 +51,21 @@ export default class ProtectedBranchAccessDropdown {
e
.
preventDefault
();
if
(
$el
.
is
(
'
.is-active
'
))
{
if
(
item
.
id
===
self
.
noOneObj
.
id
)
{
if
(
item
.
id
===
this
.
noOneObj
.
id
)
{
// remove all others selected items
self
.
accessLevelsData
.
forEach
((
level
)
=>
{
this
.
accessLevelsData
.
forEach
((
level
)
=>
{
if
(
level
.
id
!==
item
.
id
)
{
self
.
removeSelectedItem
(
level
);
this
.
removeSelectedItem
(
level
);
}
});
// remove selected item visually
self
.
$wrap
.
find
(
`.item-
${
item
.
type
}
`
).
removeClass
(
'
is-active
'
);
this
.
$wrap
.
find
(
`.item-
${
item
.
type
}
`
).
removeClass
(
'
is-active
'
);
}
else
{
const
$noOne
=
self
.
$wrap
.
find
(
`.is-active.item-
${
item
.
type
}
[data-role-id="
${
self
.
noOneObj
.
id
}
"]`
);
const
$noOne
=
this
.
$wrap
.
find
(
`.is-active.item-
${
item
.
type
}
[data-role-id="
${
this
.
noOneObj
.
id
}
"]`
);
if
(
$noOne
.
length
)
{
$noOne
.
removeClass
(
'
is-active
'
);
self
.
removeSelectedItem
(
self
.
noOneObj
);
this
.
removeSelectedItem
(
this
.
noOneObj
);
}
}
...
...
@@ -74,13 +73,13 @@ export default class ProtectedBranchAccessDropdown {
$el
.
addClass
(
`is-active item-
${
item
.
type
}
`
);
// Add "No one"
self
.
addSelectedItem
(
item
);
this
.
addSelectedItem
(
item
);
}
else
{
self
.
removeSelectedItem
(
item
);
this
.
removeSelectedItem
(
item
);
}
if
(
onSelect
)
{
onSelect
(
item
,
$el
,
self
);
onSelect
(
item
,
$el
,
this
);
}
},
});
...
...
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