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
79659b30
Commit
79659b30
authored
Jan 17, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filtered search input click back at token
Allows the user to click back around the filtered search input to change the previously searched terms
parent
0ef587b6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
filtered_search_dropdown_manager.js.es6
...s/filtered_search/filtered_search_dropdown_manager.js.es6
+14
-2
filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+1
-0
No files found.
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js.es6
View file @
79659b30
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
const filterIconPadding = 27;
const filterIconPadding = 27;
const offset = gl.text
const offset = gl.text
.getTextWidth(this.
filteredSearchInput.value
, this.font) + filterIconPadding;
.getTextWidth(this.
getSearchInput()
, this.font) + filterIconPadding;
this.mapping[key].reference.setOffset(offset);
this.mapping[key].reference.setOffset(offset);
}
}
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
setDropdown() {
setDropdown() {
const { lastToken, searchToken } = this.tokenizer
const { lastToken, searchToken } = this.tokenizer
.processTokens(this.
filteredSearchInput.value
);
.processTokens(this.
getSearchInput()
);
if (this.filteredSearchInput.value.split('').last() === ' ') {
if (this.filteredSearchInput.value.split('').last() === ' ') {
this.updateCurrentDropdownOffset();
this.updateCurrentDropdownOffset();
...
@@ -169,6 +169,18 @@
...
@@ -169,6 +169,18 @@
}
}
}
}
getSearchInput() {
const selectionStart = this.filteredSearchInput.selectionStart;
const inputValue = this.filteredSearchInput.value;
const rightPos = inputValue.slice(selectionStart).search(/\s/);
if (rightPos < 0) {
return inputValue;
}
return inputValue.slice(0, rightPos + selectionStart + 1).trim();
}
resetDropdowns() {
resetDropdowns() {
// Force current dropdown to hide
// Force current dropdown to hide
this.mapping[this.currentDropdown].reference.hideDropdown();
this.mapping[this.currentDropdown].reference.hideDropdown();
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
79659b30
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
this.filteredSearchInput.addEventListener('input', this.toggleClearSearchButtonWrapper);
this.filteredSearchInput.addEventListener('input', this.toggleClearSearchButtonWrapper);
this.filteredSearchInput.addEventListener('keydown', this.checkForEnterWrapper);
this.filteredSearchInput.addEventListener('keydown', this.checkForEnterWrapper);
this.filteredSearchInput.addEventListener('keyup', this.checkForBackspaceWrapper);
this.filteredSearchInput.addEventListener('keyup', this.checkForBackspaceWrapper);
this.filteredSearchInput.addEventListener('click', this.setDropdownWrapper);
this.clearSearchButton.addEventListener('click', this.clearSearchWrapper);
this.clearSearchButton.addEventListener('click', this.clearSearchWrapper);
}
}
...
...
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