summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-03-14 10:29:36 +0300
committerAndrew Dolgov <[email protected]>2019-03-14 10:29:36 +0300
commit09f3a8d4532a6cbda37f1b2c686a81df8cfa076a (patch)
treea772aa4ad9d717c2de3b01cb410c558cd0e1a410
parent0f370a8bda8146493bfd3543b3a227bbcbb0d02e (diff)
add fadein to columns
-rwxr-xr-xreader.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/reader.js b/reader.js
index 26f1739..8a9c884 100755
--- a/reader.js
+++ b/reader.js
@@ -396,14 +396,13 @@ $(document).ready(function () {
$("#reader img").on("load", function(e) {
const img = $(this);
- const is_right = img.hasClass('right-page');
- if (!is_right) {
- if (img.width() > img.height()) {
- $(".right-page").hide();
- } else {
- $(".right-page").show();
- }
+ img.fadeIn();
+
+ if (img.width() > img.height()) {
+ $(".right-page").hide();
+ } else {
+ $(".right-page").fadeIn();
}
window.setTimeout(() => {
@@ -466,8 +465,10 @@ $(document).ready(function () {
if ($(".right-page").is(":visible") && page > 1)
page = page - 1;
- if (page > 0)
+ if (page > 0) {
+ $("#reader img").hide();
model.currentPage(page - 1);
+ }
});
@@ -480,6 +481,7 @@ $(document).ready(function () {
page = page + 1;
if (page < model.totalPages()) {
+ $("#reader img").hide();
model.currentPage(page + 1);
}
});
@@ -514,7 +516,6 @@ $(document).ready(function () {
localforage.getItem("LAST-OPENED-FILE").then((last) => {
- const fs = remote.require('fs');
const argv = remote.process.argv;
if (argv[1] && argv[1] != ".") {