summaryrefslogtreecommitdiff
path: root/read.html
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-03-13 15:36:55 +0300
committerAndrew Dolgov <[email protected]>2018-03-13 15:36:55 +0300
commit80910996b07527f0941560bca5b598286a16ff9f (patch)
treee82546d98b2f02b958c0bc1f981a1ec3c80e918f /read.html
parentcfc197038ff9709cca3708e71f5d291ae7d54b0a (diff)
react to device orientation change to preserve lastread position
Diffstat (limited to 'read.html')
-rw-r--r--read.html29
1 files changed, 3 insertions, 26 deletions
diff --git a/read.html b/read.html
index 7b48a3c..f37bb95 100644
--- a/read.html
+++ b/read.html
@@ -738,31 +738,6 @@
localforage.setItem(cacheId("pagination"), pageList);
}
- localforage.getItem(cacheId("lastread")).then(function(item) {
- console.log('lr local', item);
-
- item = item || {};
-
- if (item.cfi) book.gotoCfi(item.cfi);
-
- if (navigator.onLine) {
-
- $.post("backend.php", { op: "getlastread", id: $.urlParam("id") }, function(data) {
- console.log('lr remote', data);
-
- if (navigator.onLine && data) {
- localforage.setItem(cacheId("lastread"),
- {cfi: data.cfi, page: data.page, total: data.total});
-
- if (item.cfi != data.cfi && (!item.page || data.page > item.page))
- book.gotoCfi(data.cfi);
-
- }
- });
- }
-
- });
-
var curPage = book.pagination.pageFromCfi(book.getCurrentLocationCfi());
$("#total_pages").html(book.pagination.totalPages);
@@ -773,9 +748,11 @@
$("#page_pct").html(pct + "%");
}
+ open_lastread();
+
window.setTimeout(function() {
$(".loading").hide();
- }, 1000);
+ }, 1500);
$(".location").click(function() {
var current = book.pagination.pageFromCfi(book.getCurrentLocationCfi());