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
Jérome Perrin
gitlab-ce
Commits
e0a79ab4
Commit
e0a79ab4
authored
Oct 07, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increase debounce wait on issues search execution.
parent
2f470a62
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
3 deletions
+40
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
app/assets/javascripts/issuable.js.es6
app/assets/javascripts/issuable.js.es6
+39
-3
No files found.
CHANGELOG.md
View file @
e0a79ab4
...
...
@@ -100,6 +100,7 @@ Please view this file on the master branch, on stable branches it's out of date.
-
Add RTL support to markdown renderer (Ebrahim Byagowi)
-
Add word-wrap to issue title on issue and milestone boards (ClemMakesApps)
-
Fix todos page mobile viewport layout (ClemMakesApps)
-
Make issues search less finicky
-
Fix inconsistent highlighting of already selected activity nav-links (ClemMakesApps)
-
Remove redundant mixins (ClemMakesApps)
-
Added 'Download' button to the Snippets page (Justin DiPierro)
...
...
app/assets/javascripts/issuable.js.es6
View file @
e0a79ab4
...
...
@@ -15,16 +15,47 @@
return Issuable.labelRow = _.template('<% _.each(labels, function(label){ %> <span class="label-row btn-group" role="group" aria-label="<%- label.title %>" style="color: <%- label.text_color %>;"> <a href="#" class="btn btn-transparent has-tooltip" style="background-color: <%- label.color %>;" title="<%- label.description %>" data-container="body"> <%- label.title %> </a> <button type="button" class="btn btn-transparent label-remove js-label-filter-remove" style="background-color: <%- label.color %>;" data-label="<%- label.title %>"> <i class="fa fa-times"></i> </button> </span> <% }); %>');
},
initSearch: function() {
const $searchInput = $('#issuable_search');
Issuable.initSearchState($searchInput);
// `immediate` param set to false debounces on the `trailing` edge, lets user finish typing
const debouncedExecSearch = _.debounce(Issuable.executeSearch,
5
00, false);
const debouncedExecSearch = _.debounce(Issuable.executeSearch,
10
00, false);
$
('#issuable_search')
.off('keyup').on('keyup', debouncedExecSearch);
$
searchInput
.off('keyup').on('keyup', debouncedExecSearch);
// ensures existing filters are preserved when manually submitted
$('#issue_search_form').on('submit', (e) => {
$('#issu
abl
e_search_form').on('submit', (e) => {
e.preventDefault();
debouncedExecSearch(e);
});
},
initSearchState: function($searchInput) {
const currentSearchVal = $searchInput.val();
Issuable.searchState = {
elem: $searchInput,
current: currentSearchVal
};
Issuable.maybeFocusOnSearch();
},
accessSearchPristine: function(set) {
// store reference to previous value to prevent search on non-mutating keyup
const state = Issuable.searchState;
const currentSearchVal = state.elem.val();
if (set) {
state.current = currentSearchVal;
} else {
return state.current === currentSearchVal;
}
},
maybeFocusOnSearch: function() {
if (Issuable.searchState.current !== '') {
Issuable.searchState.elem.focus();
}
},
executeSearch: function(e) {
const $search = $('#issuable_search');
...
...
@@ -32,6 +63,11 @@
const $searchValue = $search.val();
const $filtersForm = $('.js-filter-form');
const $input = $(`input[name='${$searchName}']`, $filtersForm);
const isPristine = Issuable.accessSearchPristine();
if (isPristine) {
return;
}
if (!$input.length) {
$filtersForm.append(`<input type='hidden' name='${$searchName}' value='${_.escape($searchValue)}'/>`);
...
...
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