summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-21 11:00:31 +0300
committerAndrew Dolgov <[email protected]>2020-04-21 11:00:31 +0300
commit67e99b59ea134c0efc6e168cadd4b7a7591d5e43 (patch)
tree35fd6bdcb4732b19bf32fa777c406656abede50b /js
parentdcc41c8200af4ed95c281a604c33c631ca5ff01b (diff)
call rendition.display() if no stored CFI received
Diffstat (limited to 'js')
-rw-r--r--js/reader.js45
1 files changed, 6 insertions, 39 deletions
diff --git a/js/reader.js b/js/reader.js
index d98e867..2688d83 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -175,41 +175,9 @@ const Reader = {
Reader.applyStyles();
});
- /*rendition.display().then(function() {
- Reader.applyStyles();
- });*/
-
- // this sets default theme, then we apply CSS to already rendered content
- // with apply_styles()
- /* displayed.then(function () {
-
- let fontSize;
- let fontFamily;
- let lineHeight;
- //let themeName;
-
- Promise.all([
- localforage.getItem("epube.fontSize"),
- localforage.getItem("epube.fontFamily"),
- localforage.getItem("epube.lineHeight"),
- localforage.getItem("epube.theme")
- ]).then(function(res) {
- fontSize = res[0] ? res[0] + "px" : DEFAULT_FONT_SIZE + "px";
- fontFamily = res[1] ? res[1] : DEFAULT_FONT_FAMILY;
- lineHeight = res[2] ? res[2] + "%" : DEFAULT_LINE_HEIGHT + "%";
- //themeName = res[3] ? res[3] : 'default';
-
- rendition.themes.default({
- html: {
- 'font-size': fontSize,
- 'font-family': "'" + fontFamily + "'",
- 'line-height': lineHeight,
- 'text-align': 'justify'
- }
- });
-
- });
- }); */
+ rendition.display().then(function() {
+ console.log("book displayed");
+ });
rendition.hooks.content.register(function(contents) {
@@ -966,7 +934,6 @@ const Reader = {
}
if (navigator.onLine) {
-
$.post("backend.php", { op: "getlastread", id: $.urlParam("id") }, function(data) {
console.log('lr remote', data);
@@ -978,9 +945,9 @@ const Reader = {
if (item.cfi != data.cfi && (!item.page || data.page >= item.page))
console.log('using remote lastread...');
- book.rendition.display(data.cfi).then(() => {
- book.rendition.display(data.cfi);
- });
+ book.rendition.display(data.cfi).then(() => {
+ book.rendition.display(data.cfi);
+ });
} catch (e) {
console.warn(e);
}