From 861f64f1afc634921e608266680a47b0278eea11 Mon Sep 17 00:00:00 2001 From: ix5 Date: Mon, 21 Mar 2022 18:26:27 +0100 Subject: [PATCH] isso: js: embed: Insert Postbox before comments (#820) This restores the behavior before #311 Closes https://github.com/posativ/isso/issues/815 Note: This is only a hotfix! --- isso/js/embed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/isso/js/embed.js b/isso/js/embed.js index 8d3415a03..1da685590 100644 --- a/isso/js/embed.js +++ b/isso/js/embed.js @@ -62,7 +62,8 @@ function fetchComments() { return; } - $('#isso-root').textContent = ''; + var isso_root = $('#isso-root'); + isso_root.textContent = ''; api.fetch(isso_thread.getAttribute("data-isso-id") || location.pathname, config["max-comments-top"], config["max-comments-nested"]).then( @@ -77,8 +78,9 @@ function fetchComments() { config[setting] = rv.config[setting] } - // Finally, create Postbox with configs fetched from server - isso_thread.append(new isso.Postbox(null)); + // Note: isso.Postbox relies on the config object populated by elements + // fetched from the server, so it cannot be created in init() + isso_root.prepend(new isso.Postbox(null)); if (rv.total_replies === 0) { heading.textContent = i18n.translate("no-comments");