summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2017-04-28 14:11:21 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2017-04-28 14:11:21 +0900
commit501678d6bb8af3613e6bb1ce7c202e843f0c0b59 (patch)
tree2a8e9bc1fc8968f9f2986fb1c2cdff42d41aca37
parent202f73e57a47a220d518e9dded5eae208ed153d5 (diff)
Fix auto-reload.js incorrect reply loading when the thread is just the opening post.
-rw-r--r--js/auto-reload.js7
1 files changed, 6 insertions, 1 deletions
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: $('<div/>').html(body).text()});
}
}
- $(this).parent().insertAfter($('div.post:not(.post-hover):last').parent().next()).after('<br class="clear">');
+ if ($("div.post").length > 1){
+ $(this).parent().insertAfter($('div.post:not(.post-hover):last').parent().next()).after('<br class="clear">');
+ }
+ else {
+ $(this).insertAfter($('div.post:not(.post-hover):last')).after('<br class="clear">');
+ }
new_posts++;
loaded_posts++;
$(document).trigger('new_post', this);