Skip to content

Commit

Permalink
fix(storefront): BCTHEME-315 Write a Review modal cause TypeError (#1899
Browse files Browse the repository at this point in the history
)

Co-authored-by: BC-tymurbiedukhin <66319629+BC-tymurbiedukhin@users.noreply.github.com>
  • Loading branch information
yurytut1993 and BC-tymurbiedukhin authored Nov 10, 2020
1 parent 0880895 commit e704b57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Write a Review modal cause TypeError. [#1899](https://github.com/bigcommerce/cornerstone/pull/1899)
- Account >Payment Methods throws Server Error when using Cornerstone theme [#1898](https://github.com/bigcommerce/cornerstone/pull/1898)
- Price in the cart is not updated when changing currency on mobile. [#1893](https://github.com/bigcommerce/cornerstone/pull/1893)

Expand Down
10 changes: 7 additions & 3 deletions assets/js/theme/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export default class Product extends PageManager {
}
});

$(document).on('opened.fndtn.reveal', () => this.reviewModal.setupFocusableElements(WRITE_REVIEW));

let validator;

// Init collapsible
Expand All @@ -40,9 +38,16 @@ export default class Product extends PageManager {

videoGallery();

this.bulkPricingHandler();

const $reviewForm = classifyForm('.writeReview-form');

if ($reviewForm.length === 0) return;

const review = new Review($reviewForm);

$(document).on('opened.fndtn.reveal', () => this.reviewModal.setupFocusableElements(WRITE_REVIEW));

$('body').on('click', '[data-reveal-id="modal-review-form"]', () => {
validator = review.registerValidation(this.context);
this.ariaDescribeReviewInputs($reviewForm);
Expand All @@ -58,7 +63,6 @@ export default class Product extends PageManager {
});

this.productReviewHandler();
this.bulkPricingHandler();
}

ariaDescribeReviewInputs($form) {
Expand Down

0 comments on commit e704b57

Please sign in to comment.