summaryrefslogtreecommitdiff
path: root/js/app.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-23 14:14:05 +0300
committerAndrew Dolgov <[email protected]>2020-04-23 14:14:05 +0300
commit4ba712725fd11023b6e95c1c6cc4e401abf53cf1 (patch)
treeeb92fa41b11ea639183d169cfd84109ce20c4d6b /js/app.js
parent7fd39431bf7c5476845f45e441836a82bef414f6 (diff)
fix App.Offline.getAll()
Diffstat (limited to 'js/app.js')
-rw-r--r--js/app.js48
1 files changed, 24 insertions, 24 deletions
diff --git a/js/app.js b/js/app.js
index 941ed1b..793c9f9 100644
--- a/js/app.js
+++ b/js/app.js
@@ -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);