fix: category dropdown search

This commit is contained in:
Barış Soner Uşaklı
2022-08-23 16:39:33 -04:00
parent 0fb0745613
commit 62ec61e00c
2 changed files with 8 additions and 3 deletions

View File

@@ -245,6 +245,10 @@ if (document.readyState === 'loading') {
els = els || $('body');
els.find('.avatar,img[title].teaser-pic,img[title].user-img,div.user-icon,span.user-icon').one('mouseenter', function (ev) {
const $this = $(this);
const title = $this.attr('title');
if (!title) {
return;
}
// perf: create tooltips on demand
$this.tooltip({
placement: placement || $this.attr('title-placement') || 'top',

View File

@@ -25,8 +25,10 @@ define('categorySearch', ['alerts'], function (alerts) {
el.on('show.bs.dropdown', function () {
if (toggleVisibility) {
el.find('.dropdown-toggle').addClass('hidden');
searchEl.removeClass('hidden');
searchEl.css({
'z-index': el.find('.dropdown-toggle').css('z-index') + 1,
});
}
function doSearch() {
@@ -58,7 +60,6 @@ define('categorySearch', ['alerts'], function (alerts) {
el.on('hide.bs.dropdown', function () {
if (toggleVisibility) {
el.find('.dropdown-toggle').removeClass('hidden');
searchEl.addClass('hidden');
}
@@ -90,7 +91,7 @@ define('categorySearch', ['alerts'], function (alerts) {
allCategoriesUrl: ajaxify.data.allCategoriesUrl,
}, function (html) {
el.find('[component="category/list"]')
.replaceWith(html.find('[component="category/list"]'));
.html(html.find('[component="category/list"]').html());
el.find('[component="category/list"] [component="category/no-matches"]')
.toggleClass('hidden', !!categories.length);
});