Skip to content

Commit da6b361

Browse files
Reverted changes fix for modal and fixed the e.stopImmediatePropagation issue
1 parent 240fc19 commit da6b361

File tree

3 files changed

+6
-34
lines changed

3 files changed

+6
-34
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ define([
9898

9999
/** @inheritdoc */
100100
always: function (e) {
101-
e.stopImmediatePropagation();
101+
if (e) {
102+
e.stopImmediatePropagation();
103+
}
102104
}
103105
}
104106
});

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,11 @@ define([
104104
/**
105105
* Escape key press handler,
106106
* close modal window
107-
* @param {Object} event - event
108107
*/
109-
escapeKey: function (event) {
108+
escapeKey: function () {
110109
if (this.options.isOpen && this.modal.find(document.activeElement).length ||
111110
this.options.isOpen && this.modal[0] === document.activeElement) {
112-
this.closeModal(event);
111+
this.closeModal();
113112
}
114113
}
115114
}

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

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,13 @@ define([
6565
click: function () {
6666
this.closeModal(true);
6767
}
68-
}],
69-
keyEventHandlers: {
70-
71-
/**
72-
* Escape key press handler,
73-
* close modal window
74-
*/
75-
escapeKey: function () {
76-
if (this.modal.find(document.activeElement).length ||
77-
this.modal[0] === document.activeElement) {
78-
this.closeModal();
79-
}
80-
}
81-
}
68+
}]
8269
},
8370

8471
/**
8572
* Create widget.
8673
*/
8774
_create: function () {
88-
_.bindAll(
89-
this,
90-
'keyEventSwitcher'
91-
);
9275
this.options.focus = this.options.promptField;
9376
this.options.validation = this.options.validation && this.options.validationRules.length;
9477
this._super();
@@ -136,18 +119,6 @@ define([
136119
return formTemplate;
137120
},
138121

139-
/**
140-
* Listener key events.
141-
* Call handler function if it exists
142-
*/
143-
keyEventSwitcher: function (event) {
144-
var key = keyCodes[event.keyCode];
145-
146-
if (this.options.keyEventHandlers.hasOwnProperty(key)) {
147-
this.options.keyEventHandlers[key].apply(this, arguments);
148-
}
149-
},
150-
151122
/**
152123
* Remove widget
153124
*/

0 commit comments

Comments
 (0)