handle notebooks is search results

when search returns a link to a notebook itself (as opposite to a
specific paragraph in it)
This commit is contained in:
felizbear 2015-12-16 11:52:35 +09:00
parent 7d06686bdc
commit 00f0315350

View file

@ -22,6 +22,12 @@ angular
results.$promise.then(function(result) {
$scope.notes = result.body.map(function(note) {
// redirect to notebook when search result is a notebook itself,
// not a paragraph
if (!/\/paragraph\//.test(note.id)) {
return note;
}
note.id = note.id.replace('paragraph/', '?paragraph=') +
'&term=' +
$routeParams.searchTerm;