Skip to content

Commit

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

Closes #815

Note: This is only a hotfix!
  • Loading branch information
ix5 authored Mar 21, 2022
1 parent c1c4596 commit 861f64f
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 861f64f

Please sign in to comment.