Skip to content

Commit 5019e74

Browse files
committed
IBX-4064: Fix search dropdown breadcrumbs VS highlight (#2558)
(cherry picked from commit c636be4)
1 parent b03865c commit 5019e74

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/js/custom.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $(document).ready(function() {
2323
'href',
2424
$(this)
2525
.attr('href')
26-
.replace('master/docs/', branchName + '/docs/')
26+
.replace('master/docs/', branchName + '/docs/'),
2727
);
2828
});
2929

@@ -153,11 +153,11 @@ $(document).ready(function() {
153153
const category = $(element).find('.algolia-docsearch-suggestion--subcategory-column-text');
154154
category.append(separatorHtml);
155155
if (title.find('.' + separatorClass).length) {
156-
$.each(title.contents(), (i, e) => {
157-
if (title.contents().length > 1) {
158-
$(e).appendTo(category);
159-
}
160-
});
156+
const titleParts = title.html().split(separatorHtml);
157+
for (let i = 0; i < titleParts.length - 1; i++) {
158+
category.html(category.html() + titleParts[i] + separatorHtml);
159+
}
160+
title.html(titleParts[titleParts.length - 1]);
161161
}
162162
if (separatorText != category.text().trim().slice(-1)) {
163163
category.append(separatorHtml);
@@ -209,7 +209,7 @@ $(document).ready(function() {
209209
if ($('.md-sidebar--secondary .md-nav__link--active').length) {
210210
$('.md-sidebar--secondary .md-nav__link--active')[0].scrollIntoView({
211211
behavior: 'instant',
212-
block: 'nearest'
212+
block: 'nearest',
213213
});
214214
} else {
215215
$('.md-sidebar--secondary .md-sidebar__scrollwrap').scrollTop(0);

0 commit comments

Comments
 (0)