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
1ac5f764
Unverified
Commit
1ac5f764
authored
Jul 08, 2016
by
Luke "Jared" Bennett
Committed by
Luke Bennett
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test turbolink condition
parent
40d869ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+5
-5
gl_dropdown_spec.js.coffee
spec/javascripts/gl_dropdown_spec.js.coffee
+4
-3
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
1ac5f764
...
...
@@ -307,7 +307,7 @@ class GitLabDropdown
shouldPropagate
:
(
e
)
=>
$target
=
$
(
e
.
target
)
if
@
options
.
multiSelect
unless
$target
.
hasClass
(
'dropdown-menu-close'
)
and
$target
.
hasClass
(
'dropdown-menu-close-icon'
)
and
$target
.
data
(
'is-link'
)
if
$target
and
not
$target
.
hasClass
(
'dropdown-menu-close'
)
and
not
$target
.
hasClass
(
'dropdown-menu-close-icon'
)
and
not
$target
.
data
(
'is-link'
)
e
.
stopPropagation
()
false
else
...
...
@@ -380,10 +380,10 @@ class GitLabDropdown
html
=
''
# Divider
return
'<li class=
'
divider
'
></li>'
if
data
is
'divider'
return
'<li class=
"divider"
></li>'
if
data
is
'divider'
# Separator is a full-width divider
return
'<li class=
'
separator
'
></li>'
if
data
is
'separator'
return
'<li class=
"separator"
></li>'
if
data
is
'separator'
# Header
return
_
.
template
(
'<li class="dropdown-header"><%- header %></li>'
)({
header
:
data
.
header
})
if
data
.
header
?
...
...
@@ -518,8 +518,8 @@ class GitLabDropdown
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
$input
=
$
(
'<input>'
).
attr
(
'type'
,
'hidden'
)
.
attr
(
'name'
,
fieldName
)
.
val
(
value
)
.
attr
(
'name'
,
fieldName
)
.
val
(
value
)
if
@
options
.
inputId
?
$input
.
attr
(
'id'
,
@
options
.
inputId
)
...
...
spec/javascripts/gl_dropdown_spec.js.coffee
View file @
1ac5f764
...
...
@@ -81,11 +81,12 @@ describe 'Dropdown', ->
navigateWithKeys
'down'
,
randomIndex
,
=>
spyOn
(
Turbolinks
,
'visit'
).
and
.
stub
()
navigateWithKeys
'enter'
,
null
,
=>
expect
(
@
dropdownContainerElement
).
not
.
toHaveClass
'open'
link
=
$
(
"
#{
ITEM_SELECTOR
}
:eq(
#{
randomIndex
}
) a"
,
@
dropdownMenuElement
)
expect
(
link
).
toHaveClass
'is-active'
if
link
.
attr
'href'
expect
(
Turbolinks
.
visit
).
toHaveBeenCalledWith
link
.
attr
'href
'
expect
(
@
dropdownContainerElement
).
not
.
toHaveClass
'open'
linkedLocation
=
link
.
attr
'href'
if
linkedLocation
and
linkedLocation
isnt
'#
'
expect
(
Turbolinks
.
visit
).
toHaveBeenCalledWith
linkedLocation
it
'should close on ESC keypress'
,
->
expect
(
@
dropdownContainerElement
).
toHaveClass
'open'
...
...
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