Use #comments-embed for embedding comments. Avoid duplicate ID

This commit is contained in:
2016-11-01 15:53:16 +01:00
parent f4b5e49c26
commit 53cbe78ec1
8 changed files with 13 additions and 9 deletions

View File

@@ -147,14 +147,17 @@ function loadComment(comment_id, projection)
function loadComments(commentsUrl)
{
var commentsContainer = $('#comments-embed');
return $.get(commentsUrl)
.done(function(dataHtml) {
// Update the DOM injecting the generate HTML into the page
$('#comments-container').html(dataHtml);
commentsContainer.html(dataHtml);
})
.fail(function(xhr) {
statusBarSet('error', "Couldn't load comments. Error: " + xhr.responseText, 'pi-attention', 5000);
$('#comments-container').html('<a id="comments-reload"><i class="pi-refresh"></i> Reload comments</a>');
commentsContainer.html('<a id="comments-reload"><i class="pi-refresh"></i> Reload comments</a>');
});
}