Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(checkout): CHECKOUT-4233 Cannot add wishlist with item when logged out #1618

Merged
merged 1 commit into from
Jan 14, 2020
Merged
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
26 changes: 0 additions & 26 deletions assets/js/theme/wishlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'foundation-sites/js/foundation/foundation';
import 'foundation-sites/js/foundation/foundation.reveal';
import nod from './common/nod';
import PageManager from './page-manager';
import { api } from '@bigcommerce/stencil-utils';
import { defaultModal } from './global/modal';

export default class WishList extends PageManager {
constructor(context) {
Expand Down Expand Up @@ -59,29 +57,6 @@ export default class WishList extends PageManager {
});
}

wishListHandler() {
$('body').on('click', '[data-wishlist]', event => {
const wishListUrl = event.currentTarget.href;
const modal = defaultModal();

event.preventDefault();

modal.open();

api.getPage(wishListUrl, this.options, (err, content) => {
if (err) {
return modal.updateContent(err);
}

modal.updateContent(content, { wrap: true });

const $wishlistForm = $('.wishlist-form', modal.$content);

this.registerAddWishListValidation($wishlistForm);
});
});
}

onReady() {
const $addWishListForm = $('.wishlist-form');

Expand All @@ -90,6 +65,5 @@ export default class WishList extends PageManager {
}

this.wishlistDeleteConfirm();
this.wishListHandler();
}
}