summaryrefslogtreecommitdiffstats
path: root/lib/models/summary.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-26 13:03:53 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-26 13:03:53 +0200
commit1057bb15d3b7250dc541a126754750ec6b8a79a2 (patch)
tree02fbc54452c038254cd2563c77755b9942d0c533 /lib/models/summary.js
parentea5e8891a833b20a2b03cc1e150fbe0d1df3a506 (diff)
downloadgitbook-1057bb15d3b7250dc541a126754750ec6b8a79a2.zip
gitbook-1057bb15d3b7250dc541a126754750ec6b8a79a2.tar.gz
gitbook-1057bb15d3b7250dc541a126754750ec6b8a79a2.tar.bz2
Complete method getByPath of Summary
Diffstat (limited to 'lib/models/summary.js')
-rw-r--r--lib/models/summary.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/models/summary.js b/lib/models/summary.js
index 4ab2d68..d0dc8af 100644
--- a/lib/models/summary.js
+++ b/lib/models/summary.js
@@ -24,7 +24,9 @@ Summary.prototype.getParts = function() {
@return {Part|Article}
*/
Summary.prototype.getByLevel = function(level) {
- return SummaryArticle.getByLevel(this, level, 'getParts');
+ return SummaryArticle.findArticle(this, function(article) {
+ return (article.getLevel() === level);
+ }, 'getParts');
};
/**
@@ -34,9 +36,9 @@ Summary.prototype.getByLevel = function(level) {
@return {Part|Article}
*/
Summary.prototype.getByPath = function(filePath) {
- // todo
-
- return undefined;
+ return SummaryArticle.findArticle(this, function(article) {
+ return (article.getPath() === filePath);
+ }, 'getParts');
};
/**