Skip to content

Commit 3ee8877

Browse files
authored
Fix issues with search javascript (#4176)
A comparison was previously relying on type coercion, and when linting fixes changed this to an exact comparison operator, this comparison started failing.
1 parent ed595b3 commit 3ee8877

File tree

1 file changed

+2
-1
lines changed
  • readthedocs/core/static-src/core/js/doc-embed

1 file changed

+2
-1
lines changed

readthedocs/core/static-src/core/js/doc-embed/search.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ function attach_elastic_search_query(data) {
4949
.attr('href', item_url)
5050
.html(fields.title)
5151
);
52-
if (fields.project !== project) {
52+
// fields.project is returned as an array
53+
if (fields.project.indexOf(project) === -1) {
5354
list_item.append(
5455
$('<span>')
5556
.text(" (from project " + fields.project + ")")

0 commit comments

Comments
 (0)