From: Radek Czajka Date: Wed, 13 Jan 2021 13:57:37 +0000 (+0100) Subject: Minor JS bugfix. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/dc73f49045fe845b141230a95f9122e2d90e6ff6 Minor JS bugfix. --- diff --git a/src/annoy/static/annoy/book_text.js b/src/annoy/static/annoy/book_text.js index bcc46f0ad..b18f1abbb 100644 --- a/src/annoy/static/annoy/book_text.js +++ b/src/annoy/static/annoy/book_text.js @@ -25,7 +25,7 @@ } }; - if (inserts) { + if (inserts.length) { var underFold = false; var counter = 0; $(".paragraph, .stanza").each(function() { @@ -46,7 +46,7 @@ return inserts.length > 0; }); /* Special case for short poems. */ - if (inserts && !counter) { + if (inserts.length && !counter) { inserts[0].insertAfter($(".paragraph, .stanza").last()); } };