Skip to content

Commit

Permalink
Example for #231
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffharrell committed Jul 31, 2014
1 parent 25ad2a7 commit 88c483f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
14 changes: 5 additions & 9 deletions dist/minicart.js
Expand Up @@ -2801,14 +2801,7 @@ function View(model) {
* Tells the view to redraw
*/
View.prototype.redraw = function redraw() {
var form;

if ((form = this.el.querySelector('form'))) {
events.remove(form, 'submit', this.model.cart.checkout);
}

this.el.innerHTML = template(config.template, this.model);
events.add(this.el.querySelector('form'), 'submit', this.model.cart.checkout, this);
};


Expand Down Expand Up @@ -2939,8 +2932,11 @@ module.exports = viewevents = {
className = target.className;

if (this.isShowing) {
// Cart checkout button
if (className === constants.SUBMIT_CLASS) {
this.model.cart.checkout(evt);
// Cart close button
if (className === constants.CLOSER_CLASS) {
} else if (className === constants.CLOSER_CLASS) {
this.hide();
// Product remove button
} else if (className === constants.REMOVE_CLASS) {
Expand Down Expand Up @@ -3021,5 +3017,5 @@ module.exports = viewevents = {

};

},{"./constants":11,"./util/events":16}]},{},[10,11,9,12,13,14,15,16,17,18,19,20,21,22,23])
},{"./constants":11,"./util/events":16}]},{},[9,12,11,14,10,13,15,16,17,18,19,20,21,22,23])
;

1 comment on commit 88c483f

@aliajmat
Copy link

@aliajmat aliajmat commented on 88c483f Dec 5, 2017

Choose a reason for hiding this comment

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

@jeffharrell how can we clear the cart after checkout?

Please sign in to comment.