summaryrefslogtreecommitdiff
path: root/js/read.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-26 13:12:33 +0300
committerAndrew Dolgov <[email protected]>2017-02-26 13:12:33 +0300
commite01f57a3d98943954372110dc75e8d731fbacc10 (patch)
tree2d57e3a2368984f03507f2650f0b94273dced625 /js/read.js
parentb8ae4b31c129031e89e4c7fb9801d6761513dd73 (diff)
further offline improvements
Diffstat (limited to 'js/read.js')
-rw-r--r--js/read.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/read.js b/js/read.js
index 9039826..dc968f4 100644
--- a/js/read.js
+++ b/js/read.js
@@ -111,10 +111,14 @@ function mark_as_read() {
function save_and_close() {
if (navigator.onLine) {
- var curPage = book.pagination.pageFromCfi(book.getCurrentLocationCfi());
+ var currentPage = book.pagination.pageFromCfi(book.getCurrentLocationCfi());
+ var currentCfi = book.getCurrentLocationCfi();
- $.post("backend.php", { op: "storelastread", id: $.urlParam("id"), page: curPage,
- cfi: book.getCurrentLocationCfi() }, function(data) {
+ localforage.setItem("epube-book." + $.urlParam("b") + ".lastread",
+ {cfi: currentCfi, page: currentPage});
+
+ $.post("backend.php", { op: "storelastread", id: $.urlParam("id"), page: currentPage,
+ cfi: currentCfi }, function(data) {
window.location = "index.php";
});
} else {