summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-29 15:27:53 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-29 15:27:53 +0200
commit730298110cea46e0c861e65d0c2c3fd82c0edd18 (patch)
tree60c7992a9c631ad5e713cb2cbea376aceea23375 /lib/models
parent07a5daefb025868ecf41054713a18d50e01511c0 (diff)
downloadgitbook-730298110cea46e0c861e65d0c2c3fd82c0edd18.zip
gitbook-730298110cea46e0c861e65d0c2c3fd82c0edd18.tar.gz
gitbook-730298110cea46e0c861e65d0c2c3fd82c0edd18.tar.bz2
Add ebook commands pdf/mobi/epub
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/book.js2
-rw-r--r--lib/models/languages.js8
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/models/book.js b/lib/models/book.js
index 693e830..f960df1 100644
--- a/lib/models/book.js
+++ b/lib/models/book.js
@@ -165,7 +165,7 @@ Book.prototype.getPage = function(ref) {
@return {Boolean}
*/
Book.prototype.isMultilingual = function() {
- return (this.getLanguages().getList().size > 0);
+ return (this.getLanguages().getCount() > 0);
};
/**
diff --git a/lib/models/languages.js b/lib/models/languages.js
index 6c19cba..069c589 100644
--- a/lib/models/languages.js
+++ b/lib/models/languages.js
@@ -35,6 +35,14 @@ Languages.prototype.getLanguage = function(lang) {
return this.getList().get(lang);
};
+/**
+ Return count of langs
+
+ @return {Number}
+*/
+Languages.prototype.getCount = function() {
+ return this.getList().size;
+};
/**
Create a languages list from a JS object