BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a3035888
Commit
a3035888
authored
Mar 27, 2018
by
bitsapien
Committed by
Clement Ho
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Fixed bug in dropdown selector when selecting the same selection again
parent
c02089af
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
2 deletions
+33
-2
gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-1
38167-ui-bug-when-creating-new-branch.yml
...logs/unreleased/38167-ui-bug-when-creating-new-branch.yml
+5
-0
gl_dropdown.html.haml
spec/javascripts/fixtures/gl_dropdown.html.haml
+2
-1
gl_dropdown_spec.js
spec/javascripts/gl_dropdown_spec.js
+25
-0
No files found.
app/assets/javascripts/gl_dropdown.js
View file @
a3035888
...
...
@@ -753,7 +753,7 @@ GitLabDropdown = (function() {
}
if
(
this
.
options
.
isSelectable
&&
!
this
.
options
.
isSelectable
(
selectedObject
,
el
))
{
return
;
return
[
selectedObject
]
;
}
if
(
el
.
hasClass
(
ACTIVE_CLASS
)
&&
value
!==
0
)
{
...
...
changelogs/unreleased/38167-ui-bug-when-creating-new-branch.yml
0 → 100644
View file @
a3035888
---
title
:
Fixed bug in dropdown selector when selecting the same selection again
merge_request
:
14631
author
:
bitsapien
type
:
fixed
spec/javascripts/fixtures/gl_dropdown.html.haml
View file @
a3035888
%div
.dropdown.inline
%button
#js-project-dropdown
.dropdown-menu-toggle
{
type:
'button'
,
data:
{
toggle:
'dropdown'
}}
Projects
.dropdown-toggle-text
Projects
%i
.fa.fa-chevron-down.dropdown-toggle-caret.js-projects-dropdown-toggle
.dropdown-menu.dropdown-select.dropdown-menu-selectable
.dropdown-title
...
...
spec/javascripts/gl_dropdown_spec.js
View file @
a3035888
...
...
@@ -256,4 +256,29 @@ describe('glDropdown', function describeDropdown() {
});
});
});
it
(
'should keep selected item after selecting a second time'
,
()
=>
{
const
options
=
{
isSelectable
(
item
,
$el
)
{
return
!
$el
.
hasClass
(
'is-active'
);
},
toggleLabel
(
item
)
{
return
item
&&
item
.
id
;
},
};
initDropDown
.
call
(
this
,
false
,
false
,
options
);
const
$item
=
$
(
`
${
ITEM_SELECTOR
}
:first() a`
,
this
.
$dropdownMenuElement
);
// select item the first time
this
.
dropdownButtonElement
.
click
();
$item
.
click
();
expect
(
$item
).
toHaveClass
(
'is-active'
);
// select item the second time
this
.
dropdownButtonElement
.
click
();
$item
.
click
();
expect
(
$item
).
toHaveClass
(
'is-active'
);
expect
(
$
(
'.dropdown-toggle-text'
)).
toHaveText
(
this
.
projectsData
[
0
].
id
.
toString
());
});
});
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