diff --git a/lib/ComicBook.js b/lib/ComicBook.js index a6be874..af99fe8 100755 --- a/lib/ComicBook.js +++ b/lib/ComicBook.js @@ -89,6 +89,14 @@ var ComicBook = (function ($) { libPath: '/lib/' }; + this.isMobile = false; + + if (navigator.userAgent.match(/mobile/i)) { + this.isMobile = true; + document.body.classList.add('mobile'); + defaults.displayMode = 'single'; + } + var options = merge(defaults, opts); // options array for internal use var no_pages = srcs.length; @@ -102,10 +110,6 @@ var ComicBook = (function ($) { var page_requested = false; // used to request non preloaded pages var shiv = false; - if (navigator.userAgent.match(/mobile/i)) { - document.body.classList.add('mobile'); - } - /** * Gets the window.innerWidth - scrollbars */