summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-10-22 12:36:11 +0300
committerAndrew Dolgov <[email protected]>2018-10-22 12:36:11 +0300
commit8df288c9eef3f1e9352a9d0e399c060265ded6ad (patch)
tree8da76e84e312f875e2a9c9eb4e2e21ccb9db1618 /read.html
parent34cfbce90fbf892caad89595efff86dd516bee22 (diff)
show lastread position when offline
Diffstat (limited to 'read.html')
-rw-r--r--read.html11
1 files changed, 9 insertions, 2 deletions
diff --git a/read.html b/read.html
index a1eddd1..f035422 100644
--- a/read.html
+++ b/read.html
@@ -508,8 +508,15 @@
$('#settings-modal').on('shown.bs.modal', function() {
- $.post("backend.php", { op: "getlastread", id: $.urlParam("id") }, function(data) {
- $(".lastread_input").val(data.page + '%');
+ localforage.getItem(cacheId("lastread")).then((item) => {
+ if (item && item.cfi) {
+ $(".lastread_input").val(item.page + '%');
+ }
+
+ $.post("backend.php", { op: "getlastread", id: $.urlParam("id") }, function(data) {
+ $(".lastread_input").val(data.page + '%');
+ });
+
});
/*localforage.getItem("epube.disable-transitions").then(function(disable) {