Skip to content

Commit 218976f

Browse files
author
Volodymyr Zaets
committed
MAGETWO-44422: Inconsistent confirm modal window behavior
- Fix mini shopping cart - Update modal and confirm widget (add event to modal and confirm callbacks )
1 parent 3596452 commit 218976f

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ define([
5353
actions: {
5454
confirm: function () {
5555
self._removeItem($(event.currentTarget));
56+
},
57+
always: function (event) {
58+
event.stopImmediatePropagation();
5659
}
5760
}
5861
});

app/code/Magento/Ui/view/base/web/js/modal/confirm.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ define([
4040
/**
4141
* Click handler.
4242
*/
43-
click: function () {
44-
this.closeModal();
43+
click: function (event) {
44+
this.closeModal(event);
4545
}
4646
}, {
4747
text: $.mage.__('OK'),
@@ -50,8 +50,8 @@ define([
5050
/**
5151
* Click handler.
5252
*/
53-
click: function () {
54-
this.closeModal(true);
53+
click: function (event) {
54+
this.closeModal(event, true);
5555
}
5656
}]
5757
},
@@ -82,15 +82,15 @@ define([
8282
/**
8383
* Close modal window.
8484
*/
85-
closeModal: function (result) {
85+
closeModal: function (event, result) {
8686
result = result || false;
8787

8888
if (result) {
89-
this.options.actions.confirm();
89+
this.options.actions.confirm(event);
9090
} else {
91-
this.options.actions.cancel();
91+
this.options.actions.cancel(event);
9292
}
93-
this.options.actions.always();
93+
this.options.actions.always(event);
9494
this.element.bind('confirmclosed', _.bind(this._remove, this));
9595

9696
return this._super();

app/code/Magento/Ui/view/base/web/js/modal/modal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ define([
7878
/**
7979
* Default action on button click
8080
*/
81-
click: function () {
82-
this.closeModal();
81+
click: function (event) {
82+
this.closeModal(event);
8383
}
8484
}]
8585
},

0 commit comments

Comments
 (0)