Skip to content
This repository was archived by the owner on Aug 30, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will take care of generating the id="comment_form", as explained in the note above :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link to the PR is broken

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a private Shopify PR so you won't have access to it. Posted it so other Shopifolk would have a reference.


{% 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