We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
mongoosejs
Learn more about funding links in repositories.
Report abuse
1 parent 0c75a1f commit fd1fa9dCopy full SHA for fd1fa9d
docs/js/search.js
@@ -9,9 +9,12 @@ for (var i = 0; i < pairs.length; ++i) {
9
}
10
11
12
+var versionFromUrl = window.location.pathname.match(/^\/docs\/(\d+\.x)/);
13
+var version = versionFromUrl ? versionFromUrl[1] : '6.x';
14
+
15
if (q != null) {
16
document.getElementById('search-input').value = decodeURIComponent(q);
- fetch(root + '/search?search=' + q).
17
+ fetch(root + '/search?search=' + q + '&version=' + version).
18
then(function(res) { return res.json(); }).
19
then(
20
function(result) {
0 commit comments