diff options
author | Andrew Dolgov <[email protected]> | 2018-10-22 12:36:11 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-10-22 12:36:11 +0300 |
commit | 8df288c9eef3f1e9352a9d0e399c060265ded6ad (patch) | |
tree | 8da76e84e312f875e2a9c9eb4e2e21ccb9db1618 /read.html | |
parent | 34cfbce90fbf892caad89595efff86dd516bee22 (diff) |
show lastread position when offline
Diffstat (limited to 'read.html')
-rw-r--r-- | read.html | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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) { |