BigW Consortium Gitlab

Commit f5719c2c by Clement Ho

Add ability to click on none as an option

parent d2ecba6e
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -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() {
......
......@@ -41,13 +41,20 @@
return config;
}
dismissDropdown() {
destroy() {
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];
}
......
......@@ -160,7 +160,7 @@
dismissCurrentDropdown() {
if (this.currentDropdown === 'hint') {
dropdownHint.dismissDropdown();
dropdownHint.destroy();
}
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment