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
Tatuya Kamada
gitlab-ce
Commits
61680a2d
Commit
61680a2d
authored
Dec 15, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add selected tagName check for itemClicked
parent
d19303cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
15 deletions
+20
-15
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+11
-9
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+9
-6
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
View file @
61680a2d
...
@@ -35,18 +35,20 @@
...
@@ -35,18 +35,20 @@
itemClicked(e) {
itemClicked(e) {
const { selected } = e.detail;
const { selected } = e.detail;
if (selected.hasAttribute('data-value')) {
if (selected.tagName === 'LI') {
if (selected.hasAttribute('data-value')) {
this.dismissDropdown();
this.dismissDropdown();
} else {
} else {
const token = selected.querySelector('.js-filter-hint').innerText.trim();
const token = selected.querySelector('.js-filter-hint').innerText.trim();
const tag = selected.querySelector('.js-filter-tag').innerText.trim();
const tag = selected.querySelector('.js-filter-tag').innerText.trim();
if (tag.length) {
if (tag.length) {
gl.FilteredSearchDropdownManager
gl.FilteredSearchDropdownManager
.addWordToInput(this.getSelectedTextWithoutEscaping(token));
.addWordToInput(this.getSelectedTextWithoutEscaping(token));
}
this.dismissDropdown();
this.dispatchInputEvent();
}
}
this.dismissDropdown();
this.dispatchInputEvent();
}
}
}
}
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
View file @
61680a2d
...
@@ -28,14 +28,17 @@
...
@@ -28,14 +28,17 @@
itemClicked(e, getValueFunction) {
itemClicked(e, getValueFunction) {
const { selected } = e.detail;
const { selected } = e.detail;
const dataValueSet = gl.DropdownUtils.setDataValueIfSelected(selected);
if (!dataValueSet) {
if (selected.tagName === 'LI') {
const value = getValueFunction(selected);
const dataValueSet = gl.DropdownUtils.setDataValueIfSelected(selected);
gl.FilteredSearchDropdownManager.addWordToInput(value);
}
if (!dataValueSet) {
const value = getValueFunction(selected);
gl.FilteredSearchDropdownManager.addWordToInput(value);
}
this.dismissDropdown();
this.dismissDropdown();
}
}
}
setAsDropdown() {
setAsDropdown() {
...
...
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