File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
app/code/Magento/Catalog/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,20 @@ define([
44
44
return this . options . processStart && this . options . processStop ;
45
45
} ,
46
46
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
+
49
55
if ( form . has ( 'input[type="file"]' ) . length && form . find ( 'input[type="file"]' ) . val ( ) !== '' ) {
50
56
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 ) ;
51
61
form . submit ( ) ;
52
62
} else {
53
63
self . ajaxSubmit ( form ) ;
You can’t perform that action at this time.
0 commit comments