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
14cd8f08
Commit
14cd8f08
authored
Jan 20, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed keyboard navigation not working in filtered search bar
parent
8a6e4152
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
droplab_filter.js
app/assets/javascripts/droplab/droplab_filter.js
+6
-2
filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+16
-3
filters.scss
app/assets/stylesheets/framework/filters.scss
+17
-7
No files found.
app/assets/javascripts/droplab/droplab_filter.js
View file @
14cd8f08
...
...
@@ -3,6 +3,7 @@
/* global droplab */
require
(
'../window'
)(
function
(
w
){
var
whiteListedKeys
=
[
37
,
38
,
39
,
40
];
w
.
droplabFilter
=
{
keydownWrapper
:
function
(
e
){
...
...
@@ -17,6 +18,10 @@ require('../window')(function(w){
return
;
}
if
(
whiteListedKeys
.
indexOf
(
e
.
detail
.
which
)
!==
-
1
)
{
return
;
}
if
(
config
&&
config
.
filterFunction
&&
typeof
config
.
filterFunction
===
'function'
)
{
filterFunction
=
config
.
filterFunction
;
}
else
{
...
...
@@ -57,4 +62,4 @@ module.exports = function(callback) {
};
},{}]},{},[
1
])(
1
)
});
\ No newline at end of file
});
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
14cd8f08
...
...
@@ -61,13 +61,26 @@
}
checkForEnter(e) {
if (e.keyCode === 38 || e.keyCode === 40) {
const selectionStart = this.filteredSearchInput.selectionStart;
e.preventDefault();
this.filteredSearchInput.setSelectionRange(selectionStart, selectionStart);
}
if (e.keyCode === 13) {
const dropdown = this.dropdownManager.mapping[this.dropdownManager.currentDropdown];
const dropdownEl = dropdown.element;
const activeElements = dropdownEl.querySelectorAll('.dropdown-active');
e.preventDefault();
// Prevent droplab from opening dropdown
this.dropdownManager.destroyDroplab();
if (!activeElements.length) {
// Prevent droplab from opening dropdown
this.dropdownManager.destroyDroplab();
this.search();
this.search();
}
}
}
...
...
app/assets/stylesheets/framework/filters.scss
View file @
14cd8f08
...
...
@@ -79,6 +79,16 @@
overflow
:
auto
;
}
%filter-dropdown-item-btn-hover
{
background-color
:
$dropdown-hover-color
;
color
:
$white-light
;
text-decoration
:
none
;
.avatar
{
border-color
:
$white-light
;
}
}
.filter-dropdown-item
{
.btn
{
border
:
none
;
...
...
@@ -103,13 +113,7 @@
&
:hover
,
&
:focus
{
background-color
:
$dropdown-hover-color
;
color
:
$white-light
;
text-decoration
:
none
;
.avatar
{
border-color
:
$white-light
;
}
@extend
%filter-dropdown-item-btn-hover
;
}
}
...
...
@@ -131,6 +135,12 @@
}
}
.filter-dropdown-item.dropdown-active
{
.btn
{
@extend
%filter-dropdown-item-btn-hover
;
}
}
.hint-dropdown
{
width
:
250px
;
}
...
...
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