Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
feat(docs): search highlight best match
Browse files Browse the repository at this point in the history
  • Loading branch information
m7r committed Sep 13, 2013
1 parent 5e914be commit 3f8d851
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/templates/css/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ img.AngularJS-small {
line-height: 14px;
}

.form-search .well li a:focus {
outline: none;
}

.form-search .well .guide {
float: right;
padding-top: 0;
Expand All @@ -126,6 +130,10 @@ img.AngularJS-small {
line-height: 20px;
}

.match > a, .nav > .match > a:hover {
background-color: #dbeaf4;
}

/* =============================== */
/* Content */
/* =============================== */
Expand Down
5 changes: 4 additions & 1 deletion src/templates/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ docsApp.controller.DocsController = function($scope, $location, $window, section
return {
first: this.$first,
last: this.$last,
active: page1 && this.currentPage == page1 || page2 && this.currentPage == page2
active: page1 && this.currentPage == page1 || page2 && this.currentPage == page2,
match: this.focused && this.currentPage != page1 &&
this.bestMatch.rank > 0 && this.bestMatch.page == page1

};
};

Expand Down

0 comments on commit 3f8d851

Please sign in to comment.