diff options
-rw-r--r-- | js/app.js | 48 |
1 files changed, 24 insertions, 24 deletions
@@ -248,6 +248,30 @@ const App = { App.Offline.populateList();
},
+ getAll: function() {
+ if (confirm("Download all books on this page?")) {
+
+ $(".row > div").each(function (i, row) {
+ const bookId = $(row).attr("id").replace("cell-", "");
+ const dropitem = $(row).find(".offline_dropitem")[0];
+
+ if (bookId) {
+
+ const cacheId = 'epube-book.' + bookId;
+ localforage.getItem(cacheId).then(function(book) {
+
+ if (!book) {
+ App.Offline.get(bookId, function() {
+ App.Offline.mark(dropitem);
+ });
+ }
+
+ });
+
+ }
+ });
+ }
+ },
markBooks: function() {
const elems = $(".offline_dropitem");
@@ -452,30 +476,6 @@ const App = { });
}
},
- getAll: function() {
- if (confirm("Download all books on this page?")) {
-
- $(".row > div").each(function (i, row) {
- const bookId = $(row).attr("id").replace("cell-", "");
- const dropitem = $(row).find(".offline_dropitem")[0];
-
- if (bookId) {
-
- const cacheId = 'epube-book.' + bookId;
- localforage.getItem(cacheId).then(function(book) {
-
- if (!book) {
- App.Offline.get(bookId, function() {
- App.Offline.mark(dropitem);
- });
- }
-
- });
-
- }
- });
- }
- },
get: function(bookId, callback) {
console.log("offline cache: " + bookId);
|