From 501678d6bb8af3613e6bb1ce7c202e843f0c0b59 Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Fri, 28 Apr 2017 14:11:21 +0900 Subject: [PATCH] Fix auto-reload.js incorrect reply loading when the thread is just the opening post. --- js/auto-reload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 0282164a..299ca166 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -236,7 +236,12 @@ $(document).ready(function(){ var n = new Notification("New reply to "+$('title').text(), {body: $('
').html(body).text()}); } } - $(this).parent().insertAfter($('div.post:not(.post-hover):last').parent().next()).after('
'); + if ($("div.post").length > 1){ + $(this).parent().insertAfter($('div.post:not(.post-hover):last').parent().next()).after('
'); + } + else { + $(this).insertAfter($('div.post:not(.post-hover):last')).after('
'); + } new_posts++; loaded_posts++; $(document).trigger('new_post', this);