diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-04-29 15:27:53 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-04-29 15:27:53 +0200 |
commit | 730298110cea46e0c861e65d0c2c3fd82c0edd18 (patch) | |
tree | 60c7992a9c631ad5e713cb2cbea376aceea23375 /lib/models | |
parent | 07a5daefb025868ecf41054713a18d50e01511c0 (diff) | |
download | gitbook-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.js | 2 | ||||
-rw-r--r-- | lib/models/languages.js | 8 |
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 |