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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
1ac5f764
Commit
1ac5f764
authored
8 years ago
by
Luke "Jared" Bennett
Committed by
Luke Bennett
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test turbolink condition
parent
40d869ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+5
-5
spec/javascripts/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
...
@@ -307,7 +307,7 @@ class GitLabDropdown
shouldPropagate
:
(
e
)
=>
shouldPropagate
:
(
e
)
=>
$target
=
$
(
e
.
target
)
if
@
options
.
multiSelect
$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
()
e
.
stopPropagation
()
false
false
else
else
...
@@ -380,10 +380,10 @@ class GitLabDropdown
...
@@ -380,10 +380,10 @@ class GitLabDropdown
html
=
''
html
=
''
# Divider
# 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
# 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
# Header
return
_
.
template
(
'<li class="dropdown-header"><%- header %></li>'
)({
header
:
data
.
header
})
if
data
.
header
?
return
_
.
template
(
'<li class="dropdown-header"><%- header %></li>'
)({
header
:
data
.
header
})
if
data
.
header
?
...
@@ -518,8 +518,8 @@ class GitLabDropdown
...
@@ -518,8 +518,8 @@ class GitLabDropdown
addInput
:
(
fieldName
,
value
)
->
addInput
:
(
fieldName
,
value
)
->
# Create hidden input for form
# Create hidden input for form
$input
=
$
(
'<input>'
).
attr
(
'type'
,
'hidden'
)
$input
=
$
(
'<input>'
).
attr
(
'type'
,
'hidden'
)
.
attr
(
'name'
,
fieldName
)
.
attr
(
'name'
,
fieldName
)
.
val
(
value
)
.
val
(
value
)
if
@
options
.
inputId
?
if
@
options
.
inputId
?
$input
.
attr
(
'id'
,
@
options
.
inputId
)
$input
.
attr
(
'id'
,
@
options
.
inputId
)
...
...
This diff is collapsed.
Click to expand it.
spec/javascripts/gl_dropdown_spec.js.coffee
View file @
1ac5f764
...
@@ -81,11 +81,12 @@ describe 'Dropdown', ->
...
@@ -81,11 +81,12 @@ describe 'Dropdown', ->
navigateWithKeys
'down'
,
randomIndex
,
=>
navigateWithKeys
'down'
,
randomIndex
,
=>
spyOn
(
Turbolinks
,
'visit'
).
and
.
stub
()
spyOn
(
Turbolinks
,
'visit'
).
and
.
stub
()
navigateWithKeys
'enter'
,
null
,
=>
navigateWithKeys
'enter'
,
null
,
=>
expect
(
@
dropdownContainerElement
).
not
.
toHaveClass
'open'
link
=
$
(
"
#{
ITEM_SELECTOR
}
:eq(
#{
randomIndex
}
) a"
,
@
dropdownMenuElement
)
link
=
$
(
"
#{
ITEM_SELECTOR
}
:eq(
#{
randomIndex
}
) a"
,
@
dropdownMenuElement
)
expect
(
link
).
toHaveClass
'is-active'
expect
(
link
).
toHaveClass
'is-active'
if
link
.
attr
'href'
linkedLocation
=
link
.
attr
'href'
expect
(
Turbolinks
.
visit
).
toHaveBeenCalledWith
link
.
attr
'href
'
if
linkedLocation
and
linkedLocation
isnt
'#
'
expect
(
@
dropdownContainerElement
).
not
.
toHaveClass
'open'
expect
(
Turbolinks
.
visit
).
toHaveBeenCalledWith
linkedLocation
it
'should close on ESC keypress'
,
->
it
'should close on ESC keypress'
,
->
expect
(
@
dropdownContainerElement
).
toHaveClass
'open'
expect
(
@
dropdownContainerElement
).
toHaveClass
'open'
...
...
This diff is collapsed.
Click to expand it.
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