Skip to content

Commit 628687b

Browse files
author
Alex Akimov
committed
MAGETWO-52013: DblClick on "Add to cart" Button
1 parent bde57fa commit 628687b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/code/Magento/Catalog/view/frontend/web/js/catalog-add-to-cart.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,20 @@ define([
4444
return this.options.processStart && this.options.processStop;
4545
},
4646

47-
submitForm: function(form) {
48-
var self = this;
47+
/**
48+
* Handler for the form 'submit' event
49+
*
50+
* @param {Object} form
51+
*/
52+
submitForm: function (form) {
53+
var addToCartButton, self = this;
54+
4955
if (form.has('input[type="file"]').length && form.find('input[type="file"]').val() !== '') {
5056
self.element.off('submit');
57+
// disable 'Add to Cart' button
58+
addToCartButton = $(form).find(this.options.addToCartButtonSelector);
59+
addToCartButton.prop('disabled', true);
60+
addToCartButton.addClass(this.options.addToCartButtonDisabledClass);
5161
form.submit();
5262
} else {
5363
self.ajaxSubmit(form);

0 commit comments

Comments
 (0)