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
37382d32
Commit
37382d32
authored
Jan 21, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow issue filter submission by clicking "Keep typing and press enter"
parent
17f0c99c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
dropdown_hint.js.es6
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+3
-0
filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+6
-0
filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+8
-0
_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+1
-1
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
View file @
37382d32
...
...
@@ -20,6 +20,9 @@
if (selected.tagName === 'LI') {
if (selected.hasAttribute('data-value')) {
this.dismissDropdown();
} else if (selected.getAttribute('data-action') === 'submit') {
this.dismissDropdown();
this.dispatchFormSubmitEvent();
} else {
const token = selected.querySelector('.js-filter-hint').innerText.trim();
const tag = selected.querySelector('.js-filter-tag').innerText.trim();
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
View file @
37382d32
...
...
@@ -84,6 +84,12 @@
}));
}
dispatchFormSubmitEvent() {
// dispatchEvent() is necessary as form.submit() does not
// trigger event handlers
this.input.form.dispatchEvent(new Event('submit'));
}
hideDropdown() {
this.getCurrentHook().list.hide();
}
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
37382d32
...
...
@@ -25,6 +25,7 @@
}
bindEvents() {
this.handleFormSubmit = this.handleFormSubmit.bind(this);
this.setDropdownWrapper = this.dropdownManager.setDropdown.bind(this.dropdownManager);
this.toggleClearSearchButtonWrapper = this.toggleClearSearchButton.bind(this);
this.checkForEnterWrapper = this.checkForEnter.bind(this);
...
...
@@ -32,6 +33,7 @@
this.checkForBackspaceWrapper = this.checkForBackspace.bind(this);
this.tokenChange = this.tokenChange.bind(this);
this.filteredSearchInput.form.addEventListener('submit', this.handleFormSubmit);
this.filteredSearchInput.addEventListener('input', this.setDropdownWrapper);
this.filteredSearchInput.addEventListener('input', this.toggleClearSearchButtonWrapper);
this.filteredSearchInput.addEventListener('keydown', this.checkForEnterWrapper);
...
...
@@ -42,6 +44,7 @@
}
unbindEvents() {
this.filteredSearchInput.form.removeEventListener('submit', this.handleFormSubmit);
this.filteredSearchInput.removeEventListener('input', this.setDropdownWrapper);
this.filteredSearchInput.removeEventListener('input', this.toggleClearSearchButtonWrapper);
this.filteredSearchInput.removeEventListener('keydown', this.checkForEnterWrapper);
...
...
@@ -88,6 +91,11 @@
this.dropdownManager.resetDropdowns();
}
handleFormSubmit(e) {
e.preventDefault();
this.search();
}
loadSearchParamsFromURL() {
const params = gl.utils.getUrlParamsArray();
const usernameParams = this.getUsernameParams();
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
37382d32
...
...
@@ -17,7 +17,7 @@
=
icon
(
'times'
)
#js-dropdown-hint
.dropdown-menu.hint-dropdown
%ul
{
'data-dropdown'
=>
true
}
%li
.filter-dropdown-item
{
'data-
value'
=>
'
'
}
%li
.filter-dropdown-item
{
'data-
action'
=>
'submit
'
}
%button
.btn.btn-link
=
icon
(
'search'
)
%span
...
...
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