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
Boxiang Sun
gitlab-ce
Commits
5f985711
Commit
5f985711
authored
Jul 06, 2016
by
Phil Hughes
Committed by
Alfredo Sumaran
Jul 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed enter submitting form in dropdown
Closes #19549
parent
aba558a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
+34
-28
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+28
-27
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+6
-1
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
5f985711
...
...
@@ -24,33 +24,34 @@ class GitLabDropdownFilter
# Key events
timeout
=
""
@
input
.
on
"keyup"
,
(
e
)
=>
keyCode
=
e
.
which
return
if
ARROW_KEY_CODES
.
indexOf
(
keyCode
)
>=
0
if
@
input
.
val
()
isnt
""
and
!
$inputContainer
.
hasClass
HAS_VALUE_CLASS
$inputContainer
.
addClass
HAS_VALUE_CLASS
else
if
@
input
.
val
()
is
""
and
$inputContainer
.
hasClass
HAS_VALUE_CLASS
$inputContainer
.
removeClass
HAS_VALUE_CLASS
if
keyCode
is
13
return
false
# Only filter asynchronously only if option remote is set
if
@
options
.
remote
clearTimeout
timeout
timeout
=
setTimeout
=>
blur_field
=
@
shouldBlur
keyCode
if
blur_field
and
@
filterInputBlur
@
input
.
blur
()
@
options
.
query
@
input
.
val
(),
(
data
)
=>
@
options
.
callback
(
data
)
,
250
else
@
filter
@
input
.
val
()
@
input
.
on
'keydown'
,
(
e
)
->
keyCode
=
e
.
which
e
.
preventDefault
()
if
keyCode
is
13
.
on
'keyup'
,
(
e
)
=>
keyCode
=
e
.
which
return
if
ARROW_KEY_CODES
.
indexOf
(
keyCode
)
>=
0
if
@
input
.
val
()
isnt
''
and
!
$inputContainer
.
hasClass
HAS_VALUE_CLASS
$inputContainer
.
addClass
HAS_VALUE_CLASS
else
if
@
input
.
val
()
is
''
and
$inputContainer
.
hasClass
HAS_VALUE_CLASS
$inputContainer
.
removeClass
HAS_VALUE_CLASS
# Only filter asynchronously only if option remote is set
if
@
options
.
remote
clearTimeout
timeout
timeout
=
setTimeout
=>
blur_field
=
@
shouldBlur
keyCode
if
blur_field
and
@
filterInputBlur
@
input
.
blur
()
@
options
.
query
@
input
.
val
(),
(
data
)
=>
@
options
.
callback
(
data
)
,
250
else
@
filter
@
input
.
val
()
shouldBlur
:
(
keyCode
)
->
return
BLUR_KEYCODES
.
indexOf
(
keyCode
)
>=
0
...
...
app/assets/javascripts/project.js.coffee
View file @
5f985711
...
...
@@ -87,5 +87,10 @@ class @Project
toggleLabel
:
(
obj
,
$el
)
->
$el
.
text
().
trim
()
clicked
:
(
e
)
->
$dropdown
.
closest
(
'form'
).
submit
()
if
$
(
'input[name="ref"]'
).
length
$form
=
$dropdown
.
closest
(
'form'
)
action
=
$form
.
attr
(
'action'
)
divider
=
if
action
.
indexOf
(
'?'
)
<
0
then
'?'
else
'&'
Turbolinks
.
visit
"
#{
action
}#{
divider
}#{
$form
.
serialize
()
}
"
)
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