Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
e5fc22cc
Commit
e5fc22cc
authored
10 years ago
by
fat
Browse files
Options
Download
Email Patches
Plain Diff
Escape key should only close Dropdown
parent
64a74e93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/dropdown.js
+4
-4
js/dropdown.js
with
4 additions
and
4 deletions
+4
-4
js/dropdown.js
+
4
-
4
View file @
e5fc22cc
...
...
@@ -55,7 +55,7 @@
}
Dropdown
.
prototype
.
keydown
=
function
(
e
)
{
if
(
!
/
(
38|40|27
)
/
.
test
(
e
.
keyCode
))
return
if
(
!
/
(
38|40|27
|32
)
/
.
test
(
e
.
which
))
return
var
$this
=
$
(
this
)
...
...
@@ -67,7 +67,7 @@
var
$parent
=
getParent
(
$this
)
var
isActive
=
$parent
.
hasClass
(
'
open
'
)
if
(
!
isActive
||
(
isActive
&&
e
.
keyCode
==
27
))
{
if
(
(
!
isActive
&&
e
.
which
!=
27
)
||
(
isActive
&&
e
.
which
==
27
))
{
if
(
e
.
which
==
27
)
$parent
.
find
(
toggle
).
trigger
(
'
focus
'
)
return
$this
.
trigger
(
'
click
'
)
}
...
...
@@ -79,8 +79,8 @@
var
index
=
$items
.
index
(
$items
.
filter
(
'
:focus
'
))
if
(
e
.
keyCode
==
38
&&
index
>
0
)
index
--
// up
if
(
e
.
keyCode
==
40
&&
index
<
$items
.
length
-
1
)
index
++
// down
if
(
e
.
which
==
38
&&
index
>
0
)
index
--
// up
if
(
e
.
which
==
40
&&
index
<
$items
.
length
-
1
)
index
++
// down
if
(
!~
index
)
index
=
0
$items
.
eq
(
index
).
trigger
(
'
focus
'
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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