diff options
author | Andrew Dolgov <[email protected]> | 2019-03-14 10:38:24 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-14 10:38:24 +0300 |
commit | 2a00d6d2f7c76c43eb8becf244a4e1665cc92435 (patch) | |
tree | 1801f6de01438ae94a6968d415aa3964b7324c1a | |
parent | 09f3a8d4532a6cbda37f1b2c686a81df8cfa076a (diff) |
fix limit-width to never apply in single-column; fix auto-disabling of two columns
-rwxr-xr-x | reader.css | 2 | ||||
-rwxr-xr-x | reader.js | 11 |
2 files changed, 7 insertions, 6 deletions
@@ -109,7 +109,7 @@ margin: auto; } -#reader.fit-size img.limit-width { +#reader.fit-size:not(.single-column) img.limit-width { max-width : 50%; } @@ -395,14 +395,15 @@ $(document).ready(function () { } $("#reader img").on("load", function(e) { - const img = $(this); + const left = $("#reader .left-page"); + const right = $("#reader .right-page"); - img.fadeIn(); + left.fadeIn(); - if (img.width() > img.height()) { - $(".right-page").hide(); + if (left.width() >= left.height() || right.width() >= right.height()) { + right.hide(); } else { - $(".right-page").fadeIn(); + right.fadeIn(); } window.setTimeout(() => { |