|
195 | 195 | self._onKeyDown = function(e) {
|
196 | 196 | if (e.keyCode === 27 && self._options.exitOnEsc == true) {
|
197 | 197 | //escape key pressed, exit the intro
|
198 |
| - _exitIntro.call(self, targetElm); |
199 |
| - //check if any callback is defined |
| 198 | + //check if exit callback is defined |
200 | 199 | if (self._introExitCallback != undefined) {
|
201 | 200 | self._introExitCallback.call(self);
|
202 | 201 | }
|
| 202 | + _exitIntro.call(self, targetElm); |
203 | 203 | } else if(e.keyCode === 37) {
|
204 | 204 | //left arrow
|
205 | 205 | _previousStep.call(self);
|
|
214 | 214 | _previousStep.call(self);
|
215 | 215 | } else if (target && target.className.indexOf('introjs-skipbutton') > 0) {
|
216 | 216 | //user hit enter while focusing on skip button
|
| 217 | + if (self._introItems.length - 1 == self._currentStep && typeof (self._introCompleteCallback) === 'function') { |
| 218 | + self._introCompleteCallback.call(self); |
| 219 | + } |
| 220 | + //check if any callback is defined |
| 221 | + if (self._introExitCallback != undefined) { |
| 222 | + self._introExitCallback.call(self); |
| 223 | + } |
217 | 224 | _exitIntro.call(self, targetElm);
|
218 | 225 | } else {
|
219 | 226 | //default behavior for responding to enter
|
|
1072 | 1079 |
|
1073 | 1080 | overlayLayer.onclick = function() {
|
1074 | 1081 | if (self._options.exitOnOverlayClick == true) {
|
1075 |
| - _exitIntro.call(self, targetElm); |
1076 | 1082 |
|
1077 | 1083 | //check if any callback is defined
|
1078 | 1084 | if (self._introExitCallback != undefined) {
|
1079 | 1085 | self._introExitCallback.call(self);
|
1080 | 1086 | }
|
| 1087 | + _exitIntro.call(self, targetElm); |
1081 | 1088 | }
|
1082 | 1089 | };
|
1083 | 1090 |
|
|
0 commit comments