Skip to content

Commit

Permalink
isso: js: embed: Insert Postbox before comments
Browse files Browse the repository at this point in the history
This restores the behavior before isso-comments#311

Closes isso-comments#815

Note: This is only a hotfix!
  • Loading branch information
ix5 committed Mar 20, 2022
1 parent f947eae commit 5434ff0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions isso/js/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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");
Expand Down

0 comments on commit 5434ff0

Please sign in to comment.