Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #483 from Shopify/comment-form
Browse files Browse the repository at this point in the history
Update article comment form ids
  • Loading branch information
cshold committed Nov 10, 2015
2 parents 04c96e7 + ab7d2d7 commit 68aa090
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 32 deletions.
5 changes: 0 additions & 5 deletions assets/timber.js.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,6 @@ timber.getHash = function () {
return window.location.hash;
};

timber.updateHash = function (hash) {
window.location.hash = '#' + hash;
$('#' + hash).attr('tabindex', -1).focus();
};

timber.productPage = function (options) {
var moneyFormat = options.money_format,
variant = options.variant,
Expand Down
5 changes: 0 additions & 5 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,6 @@
Template-specific js
{% endcomment %}
<script>
{% if newHash %}
$(function() {
timber.updateHash('{{ newHash }}');
});
{% endif %}
{% if resetPassword %}
$(function() {
timber.resetPasswordSuccess();
Expand Down
25 changes: 3 additions & 22 deletions templates/article.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
{% endcomment %}
{% paginate article.comments by 5 %}
{% comment %}
#Comments is required, it is used as an anchor link by Shopify.
#comments is required, it is used as an anchor link by Shopify.
{% endcomment %}
<div id="Comments">
<div id="comments">

{% if comment and comment.created_at %}
<p class="note form-success">
Expand Down Expand Up @@ -127,16 +127,9 @@

{% endif %}

{% comment %}
Comment submission form
{% endcomment %}
<div class="form-vertical">
{% form 'new_comment', article %}

{% comment %}
#AddCommentTitle is used simply as an anchor link
{% endcomment %}
<h3 id="AddCommentTitle">{{ 'blogs.comments.title' | t }}</h3>
<h3>{{ 'blogs.comments.title' | t }}</h3>

{{ form.errors | default_errors }}

Expand All @@ -162,18 +155,6 @@
{% endif %}

<input type="submit" class="btn" value="{{ 'blogs.comments.post' | t }}">

{% comment %}
Assign variable to be used after timber.init() is run in theme.liquid
{% endcomment %}
{% if form.errors %}
{% assign newHash = 'AddCommentTitle' %}
{% endif %}

{% if form.posted_successfully? %}
{% assign newHash = 'Comments' %}
{% endif %}

{% endform %}
</div>

Expand Down

0 comments on commit 68aa090

Please sign in to comment.