Skip to content

Commit 20a998d

Browse files
committed
Merge branch 'MAGETWO-97916' into 2.3-develop-pr15
2 parents da1173a + 19d5c98 commit 20a998d

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

app/code/Magento/Msrp/view/base/web/js/msrp.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ define([
7373
this.initTierPopup();
7474
}
7575
$(this.options.cartButtonId).on('click', this._addToCartSubmit.bind(this));
76+
$(this.options.cartForm).on('submit', this._onSubmitForm.bind(this));
7677
},
7778

7879
/**
@@ -249,8 +250,10 @@ define([
249250

250251
/**
251252
* Handler for addToCart action
253+
*
254+
* @param {Object} e
252255
*/
253-
_addToCartSubmit: function () {
256+
_addToCartSubmit: function (e) {
254257
this.element.trigger('addToCart', this.element);
255258

256259
if (this.element.data('stop-processing')) {
@@ -266,8 +269,20 @@ define([
266269
if (this.options.addToCartUrl) {
267270
$('.mage-dropdown-dialog > .ui-dialog-content').dropdownDialog('close');
268271
}
272+
273+
e.preventDefault();
269274
$(this.options.cartForm).submit();
275+
},
270276

277+
/**
278+
* Handler for submit form
279+
*
280+
* @private
281+
*/
282+
_onSubmitForm: function () {
283+
if ($(this.options.cartForm).valid()) {
284+
$(this.options.cartButtonId).prop('disabled', true);
285+
}
271286
}
272287
});
273288

app/code/Magento/ProductVideo/view/frontend/web/js/fotorama-add-video-events.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,14 @@ define([
177177
* @private
178178
*/
179179
clearEvents: function () {
180-
this.fotoramaItem.off(
181-
'fotorama:show.' + this.PV +
182-
' fotorama:showend.' + this.PV +
183-
' fotorama:fullscreenenter.' + this.PV +
184-
' fotorama:fullscreenexit.' + this.PV
185-
);
180+
if (this.fotoramaItem !== undefined) {
181+
this.fotoramaItem.off(
182+
'fotorama:show.' + this.PV +
183+
' fotorama:showend.' + this.PV +
184+
' fotorama:fullscreenenter.' + this.PV +
185+
' fotorama:fullscreenexit.' + this.PV
186+
);
187+
}
186188
},
187189

188190
/**

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,10 @@ define([
12291229
}
12301230

12311231
imagesToUpdate = this._setImageIndex(imagesToUpdate);
1232-
gallery.updateData(imagesToUpdate);
1232+
1233+
if (!_.isUndefined(gallery)) {
1234+
gallery.updateData(imagesToUpdate);
1235+
}
12331236

12341237
if (isInitial) {
12351238
$(this.options.mediaGallerySelector).AddFotoramaVideoEvents();

0 commit comments

Comments
 (0)