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
f5719c2c
Commit
f5719c2c
authored
Dec 05, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to click on none as an option
parent
d2ecba6e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
14 deletions
+46
-14
app/assets/javascripts/filtered_search/dropdown_assignee.js.es6
...sets/javascripts/filtered_search/dropdown_assignee.js.es6
+7
-1
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
+0
-5
app/assets/javascripts/filtered_search/dropdown_label.js.es6
app/assets/javascripts/filtered_search/dropdown_label.js.es6
+8
-1
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
...ets/javascripts/filtered_search/dropdown_milestone.js.es6
+7
-1
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
...vascripts/filtered_search/filtered_search_dropdown.js.es6
+18
-1
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+1
-1
app/views/shared/issuable/_search_bar.html.haml
app/views/shared/issuable/_search_bar.html.haml
+5
-4
No files found.
app/assets/javascripts/filtered_search/dropdown_assignee.js.es6
View file @
f5719c2c
...
...
@@ -9,7 +9,13 @@
}
itemClicked(e) {
console.log('assignee clicked');
const dataValueSet = this.setDataValueIfSelected(e.detail.selected);
if (!dataValueSet) {
console.log('set value');
}
this.dismissDropdown();
}
renderContent() {
...
...
app/assets/javascripts/filtered_search/dropdown_hint.js.es6
View file @
f5719c2c
...
...
@@ -39,12 +39,7 @@
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(token));
}
this.input.focus();
this.dismissDropdown();
// Propogate input change to FilteredSearchManager
// so that it can determine which dropdowns to open
this.input.dispatchEvent(new Event('input'));
}
renderContent() {
...
...
app/assets/javascripts/filtered_search/dropdown_label.js.es6
View file @
f5719c2c
...
...
@@ -9,7 +9,14 @@
}
itemClicked(e) {
console.log('label clicked');
const dataValueSet = this.setDataValueIfSelected(e.detail.selected);
if (!dataValueSet) {
const labelName = `~${e.detail.selected.querySelector('.label-title').innerText.trim()}`;
gl.FilteredSearchManager.addWordToInput(this.getSelectedText(labelName));
}
this.dismissDropdown();
}
renderContent() {
...
...
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
View file @
f5719c2c
...
...
@@ -9,7 +9,13 @@
}
itemClicked(e) {
console.log('milestone clicked');
const dataValueSet = this.setDataValueIfSelected(e.detail.selected);
if (!dataValueSet) {
console.log('set value');
}
this.dismissDropdown();
}
renderContent() {
...
...
app/assets/javascripts/filtered_search/filtered_search_dropdown.js.es6
View file @
f5719c2c
...
...
@@ -41,13 +41,20 @@
return config;
}
d
ismissDropdown
() {
d
estroy
() {
this.input.setAttribute(DATA_DROPDOWN_TRIGGER, '');
droplab.setConfig(this.getFilterConfig());
droplab.setData(this.hookId, []);
this.unbindEvents();
}
dismissDropdown() {
this.input.focus();
// Propogate input change to FilteredSearchManager
// so that it can determine which dropdowns to open
this.input.dispatchEvent(new Event('input'));
}
setAsDropdown() {
this.input.setAttribute(DATA_DROPDOWN_TRIGGER, `#${this.listId}`);
}
...
...
@@ -56,6 +63,16 @@
this.dropdown.style.left = `${offset}px`;
}
setDataValueIfSelected(selected) {
const dataValue = selected.getAttribute('data-value');
if (dataValue) {
gl.FilteredSearchManager.addWordToInput(dataValue);
}
return dataValue !== null;
}
getCurrentHook() {
return droplab.hooks.filter(h => h.id === this.hookId)[0];
}
...
...
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
f5719c2c
...
...
@@ -160,7 +160,7 @@
dismissCurrentDropdown() {
if (this.currentDropdown === 'hint') {
dropdownHint.d
ismissDropdown
();
dropdownHint.d
estroy
();
}
}
...
...
app/views/shared/issuable/_search_bar.html.haml
View file @
f5719c2c
...
...
@@ -36,7 +36,7 @@
@{{username}}
#js-dropdown-assignee
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
%li
.filter-dropdown-item
%li
.filter-dropdown-item
{
'data-value'
:
'none'
}
%button
.btn.btn-link
No assignee
%li
.divider
...
...
@@ -51,7 +51,7 @@
@{{username}}
#js-dropdown-milestone
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
%li
.filter-dropdown-item
%li
.filter-dropdown-item
{
'data-value'
:
'none'
}
%button
.btn.btn-link
No milestone
%li
.divider
...
...
@@ -61,7 +61,7 @@
{{title}}
#js-dropdown-label
.dropdown-menu
{
'data-dropdown'
=>
true
}
%ul
%li
.filter-dropdown-item
%li
.filter-dropdown-item
{
'data-value'
:
'none'
}
%button
.btn.btn-link
No label
%li
.divider
...
...
@@ -69,7 +69,8 @@
%li
.filter-dropdown-item
%button
.btn.btn-link
%span
.dropdown-label-box
{
'style'
:
'
background:
{{
color
}}
'
}
{{title}}
%span
.label-title
{{title}}
.pull-right
-
if
boards_page
#js-boards-seach
.issue-boards-search
...
...
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