File tree 3 files changed +6
-34
lines changed
Checkout/view/frontend/web/js
Ui/view/base/web/js/modal
3 files changed +6
-34
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ define([
98
98
99
99
/** @inheritdoc */
100
100
always : function ( e ) {
101
- e . stopImmediatePropagation ( ) ;
101
+ if ( e ) {
102
+ e . stopImmediatePropagation ( ) ;
103
+ }
102
104
}
103
105
}
104
106
} ) ;
Original file line number Diff line number Diff line change @@ -104,12 +104,11 @@ define([
104
104
/**
105
105
* Escape key press handler,
106
106
* close modal window
107
- * @param {Object } event - event
108
107
*/
109
- escapeKey : function ( event ) {
108
+ escapeKey : function ( ) {
110
109
if ( this . options . isOpen && this . modal . find ( document . activeElement ) . length ||
111
110
this . options . isOpen && this . modal [ 0 ] === document . activeElement ) {
112
- this . closeModal ( event ) ;
111
+ this . closeModal ( ) ;
113
112
}
114
113
}
115
114
}
Original file line number Diff line number Diff line change @@ -65,30 +65,13 @@ define([
65
65
click : function ( ) {
66
66
this . closeModal ( true ) ;
67
67
}
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
+ } ]
82
69
} ,
83
70
84
71
/**
85
72
* Create widget.
86
73
*/
87
74
_create : function ( ) {
88
- _ . bindAll (
89
- this ,
90
- 'keyEventSwitcher'
91
- ) ;
92
75
this . options . focus = this . options . promptField ;
93
76
this . options . validation = this . options . validation && this . options . validationRules . length ;
94
77
this . _super ( ) ;
@@ -136,18 +119,6 @@ define([
136
119
return formTemplate ;
137
120
} ,
138
121
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
-
151
122
/**
152
123
* Remove widget
153
124
*/
You can’t perform that action at this time.
0 commit comments