summaryrefslogtreecommitdiffstats
path: root/lib/utils/navigation.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils/navigation.js')
-rw-r--r--lib/utils/navigation.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/utils/navigation.js b/lib/utils/navigation.js
index af9330d..d825c2c 100644
--- a/lib/utils/navigation.js
+++ b/lib/utils/navigation.js
@@ -27,7 +27,7 @@ function navigation(summary, files) {
files = _.isArray(files) ? files : (_.isString(files) ? [files] : null);
// List of all navNodes
- // Flatten chapters, then add in default README node if needed etc ...
+ // Flatten chapters
var navNodes = flattenChapters(summary.chapters);
// Mapping of prev/next for a give path
@@ -39,8 +39,7 @@ function navigation(summary, files) {
if(!current.exists) return null;
// Find prev
- prev = _.chain(navNodes)
- .slice(0, i)
+ prev = _.chain(navNodes.slice(0, i))
.reverse()
.find(function(node) {
return node.exists && !node.external;
@@ -48,14 +47,12 @@ function navigation(summary, files) {
.value();
// Find next
- next = _.chain(navNodes)
- .slice(i+1)
+ next = _.chain(navNodes.slice(i+1))
.find(function(node) {
return node.exists && !node.external;
})
.value();
-
return [current.path, {
index: i,
title: current.title,