Commit 2f8fada6 authored by Luke Bennett's avatar Luke Bennett

Fixed conflicts

parent 3e1e9b67
...@@ -111,9 +111,9 @@ ...@@ -111,9 +111,9 @@
matches = fuzzaldrinPlus.match($el.text().trim(), search_text); matches = fuzzaldrinPlus.match($el.text().trim(), search_text);
if (!$el.is('.dropdown-header')) { if (!$el.is('.dropdown-header')) {
if (matches.length) { if (matches.length) {
return $el.show(); return $el.show().removeClass('option-hidden');
} else { } else {
return $el.hide(); return $el.hide().addClass('option-hidden');
} }
} }
}); });
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
currentIndex = -1; currentIndex = -1;
NON_SELECTABLE_CLASSES = '.divider, .separator, .dropdown-header, .dropdown-menu-empty-link'; NON_SELECTABLE_CLASSES = '.divider, .separator, .dropdown-header, .dropdown-menu-empty-link, .option-hidden';
SELECTABLE_CLASSES = ".dropdown-content li:not(" + NON_SELECTABLE_CLASSES + ")"; SELECTABLE_CLASSES = ".dropdown-content li:not(" + NON_SELECTABLE_CLASSES + ")";
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
keys: searchFields, keys: searchFields,
elements: (function(_this) { elements: (function(_this) {
return function() { return function() {
selector = SELECTABLE_CLASSES; selector = '.dropdown-content li:not(' + NON_SELECTABLE_CLASSES + ')';
if (_this.dropdown.find('.dropdown-toggle-page').length) { if (_this.dropdown.find('.dropdown-toggle-page').length) {
selector = ".dropdown-page-one " + selector; selector = ".dropdown-page-one " + selector;
} }
...@@ -263,7 +263,7 @@ ...@@ -263,7 +263,7 @@
return function(data) { return function(data) {
_this.parseData(data); _this.parseData(data);
if (_this.filterInput.val() !== '') { if (_this.filterInput.val() !== '') {
selector = '.dropdown-content li:not(.divider):visible'; selector = SELECTABLE_CLASSES;
if (_this.dropdown.find('.dropdown-toggle-page').length) { if (_this.dropdown.find('.dropdown-toggle-page').length) {
selector = ".dropdown-page-one " + selector; selector = ".dropdown-page-one " + selector;
} }
...@@ -502,7 +502,7 @@ ...@@ -502,7 +502,7 @@
text = this.highlightTextMatches(text, this.filterInput.val()); text = this.highlightTextMatches(text, this.filterInput.val());
} }
if (group) { if (group) {
groupAttrs = "data-group='" + group + "' data-index='" + index + "'"; groupAttrs = 'data-group=' + group + ' data-index=' + index;
} else { } else {
groupAttrs = ''; groupAttrs = '';
} }
...@@ -617,11 +617,8 @@ ...@@ -617,11 +617,8 @@
} }
$el = $(selector, this.dropdown); $el = $(selector, this.dropdown);
if ($el.length) { if ($el.length) {
return $el.first().trigger('click');
e.preventDefault();
e.stopImmediatePropagation();
$el.first().trigger('click'); $el.first().trigger('click');
href = $el.attr('href'); var href = $el.attr('href');
if (href && href !== '#') Turbolinks.visit(href); if (href && href !== '#') Turbolinks.visit(href);
} }
}; };
...@@ -691,8 +688,8 @@ ...@@ -691,8 +688,8 @@
if (!index) { if (!index) {
$dropdownContent.scrollTop(0) $dropdownContent.scrollTop(0)
} else if (index === ($listItems.length - 1)) { } else if (index === ($listItems.length - 1)) {
$dropdownContent.scrollTop $dropdownContent.prop('scrollHeight'); $dropdownContent.scrollTop($dropdownContent.prop('scrollHeight'));
} else if (listItemBottom > (dropdownContentBottom + dropdownScrollTop)) } else if (listItemBottom > (dropdownContentBottom + dropdownScrollTop)) {
$dropdownContent.scrollTop(listItemBottom - dropdownContentBottom + CURSOR_SELECT_SCROLL_PADDING); $dropdownContent.scrollTop(listItemBottom - dropdownContentBottom + CURSOR_SELECT_SCROLL_PADDING);
} else if (listItemTop < (dropdownContentTop + dropdownScrollTop)) { } else if (listItemTop < (dropdownContentTop + dropdownScrollTop)) {
return $dropdownContent.scrollTop(listItemTop - dropdownContentTop - CURSOR_SELECT_SCROLL_PADDING); return $dropdownContent.scrollTop(listItemTop - dropdownContentTop - CURSOR_SELECT_SCROLL_PADDING);
......
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
selectable: true, selectable: true,
data: this.projectsData, data: this.projectsData,
text: (project) => { text: (project) => {
(project.name_with_namespace || project.name) (project.name_with_namespace || project.name);
}, },
id: (project) => { id: (project) => {
project.id project.id;
} }
}); });
}); });
......
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