Skip to content

Commit

Permalink
Fix bug with unresponsive "back to shop" button
Browse files Browse the repository at this point in the history
  • Loading branch information
tomik-z-cech committed Feb 29, 2024
1 parent d407252 commit afa6f55
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
10 changes: 6 additions & 4 deletions items/templates/items/item_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ <h3>
Comment
{% endif %}
</div>
<div class="col-4" id="back-to-shop">
<i class="bi bi-arrow-left-square"></i>
&nbsp;
Continue Shopping
<div class="col-4">
<a href="{% url 'shop' category_pk=0 %}" aria-label="Continue Shopping" id="back-to-shop">
<i class="bi bi-arrow-left-square"></i>
&nbsp;
Continue Shopping
</a>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions static/css/items.css
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@

#back-to-shop {
margin-top: 5vh;
text-decoration: none;
}

.product-detail-input {
Expand Down
6 changes: 0 additions & 6 deletions static/js/product_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,5 @@ $(document).ready(function() {
$('#img1').removeClass('image-small').addClass('image-large');
// Set the other images small
$('#img2, #img3').removeClass('image-large').addClass('image-small');
if (document.referrer) {
let previousDestination = document.referrer;
$('#back-to-shop').click(function(){
window.location.href = previousDestination;
});
};
});
});
1 change: 1 addition & 0 deletions vault/templates/vault/vault.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ <h1>
<hr>
{% for row in vault_content %}
<div class="row">
{{ forloop.counter0 }}
<div class="col-2 d-flex justify-content-center align-items-center">
<a href="{% url 'item-detail' item_pk=row.0 %}" aria-label="Details of {{ row.4 }}">
{% if row.5 == '' or row.5 == 'False' %}
Expand Down

0 comments on commit afa6f55

Please sign in to comment.