Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 0efef23

Browse files
committed
chore(docs): display search result areas in a fixed order
1 parent 7da22e6 commit 0efef23

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/app/src/search.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ angular.module('search', [])
1111
var MIN_SEARCH_LENGTH = 2;
1212
if(q.length >= MIN_SEARCH_LENGTH) {
1313
docsSearch(q).then(function(hits) {
14-
var results = {};
14+
// Make sure the areas are always in the same order
15+
var results = {
16+
api: [],
17+
guide: [],
18+
tutorial: [],
19+
error: [],
20+
misc: []
21+
};
22+
1523
angular.forEach(hits, function(hit) {
1624
var area = hit.area;
1725

docs/config/templates/indexPage.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
<div class="search-results-container" ng-show="hasResults">
148148
<div class="container">
149149
<div class="search-results-frame">
150-
<div ng-repeat="(key, value) in results" class="search-results-group" ng-class="colClassName + ' col-group-' + key">
150+
<div ng-repeat="(key, value) in results track by key" class="search-results-group" ng-class="colClassName + ' col-group-' + key" ng-show="value.length > 0">
151151
<h4 class="search-results-group-heading">{{ key }}</h4>
152152
<ul class="search-results">
153153
<!-- Do not insert a line break between li and a. Chrome will insert an actual line-break, which breaks the list item view.

0 commit comments

Comments
 (0)