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

This commit is contained in:
Pablo Vazquez 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) function loadComments(commentsUrl)
{ {
var commentsContainer = $('#comments-embed');
return $.get(commentsUrl) return $.get(commentsUrl)
.done(function(dataHtml) { .done(function(dataHtml) {
// Update the DOM injecting the generate HTML into the page // Update the DOM injecting the generate HTML into the page
$('#comments-container').html(dataHtml); commentsContainer.html(dataHtml);
}) })
.fail(function(xhr) { .fail(function(xhr) {
statusBarSet('error', "Couldn't load comments. Error: " + xhr.responseText, 'pi-attention', 5000); 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>');
}); });
} }

View File

@ -2,10 +2,8 @@ $comments-width-max: 710px
#comments-container #comments-container
margin-top: 15px margin-top: 15px
padding: 5px 20px 20px 20px
position: relative position: relative
border-top: 1px solid $color-background border-top: 1px solid $color-background
min-height: 170px min-height: 170px
&.texture &.texture

View File

@ -689,6 +689,8 @@ ul.project_nav-edit-list
&.active &.active
opacity: 1 opacity: 1
#comments-embed
padding: 5px 20px 20px 20px
/* Project context on the right of the navigation */ /* Project context on the right of the navigation */
/* Contains #project_context */ /* Contains #project_context */

View File

@ -97,7 +97,7 @@
| {% endif %} | {% endif %}
#comments-container #comments-embed
#comments-list-items-loading #comments-list-items-loading
i.pi-spin i.pi-spin

View File

@ -102,7 +102,8 @@
| {% if (node._created | pretty_date) != (node._updated | pretty_date) %} | {% if (node._created | pretty_date) != (node._updated | pretty_date) %}
span(title="Updated {{ node._updated }}") (updated {{ node._updated | pretty_date }}) span(title="Updated {{ node._updated }}") (updated {{ node._updated | pretty_date }})
| {% endif %} | {% endif %}
#comments-container
#comments-embed
#comments-list-items-loading #comments-list-items-loading
i.pi-spin i.pi-spin

View File

@ -114,7 +114,7 @@
| {% endif %} | {% endif %}
#comments-container #comments-embed
#comments-list-items-loading #comments-list-items-loading
i.pi-spin i.pi-spin

View File

@ -40,7 +40,7 @@
a(href="{{ node.short_link }}") {{ node.short_link }} a(href="{{ node.short_link }}") {{ node.short_link }}
| {% endif %} | {% endif %}
#comments-container #comments-embed
#comments-list-items-loading #comments-list-items-loading
i.pi-spin i.pi-spin

View File

@ -75,7 +75,7 @@ meta(name="twitter:description", content="{{ node.properties.content }}")
| {{ node.properties.content }} | {{ node.properties.content }}
#comments-container #comments-embed
#comments-list-items-loading #comments-list-items-loading
i.pi-spin i.pi-spin