Skip to content

Commit c4de80d

Browse files
authored
Merge pull request usablica#517 from labithiotis/master
Added callback for onskip event (clicking skip inside tooltip container)
2 parents 5d74f6a + f86f668 commit c4de80d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

intro.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,12 @@
12591259
self._introCompleteCallback.call(self);
12601260
}
12611261

1262+
1263+
if (self._introItems.length - 1 != self._currentStep && typeof (self._introExitCallback) === 'function') {
1264+
self._introExitCallback.call(self);
1265+
}
1266+
1267+
self._introSkipCallback.call(self);
12621268
_exitIntro.call(self, self._targetElement);
12631269
};
12641270

@@ -2465,6 +2471,14 @@
24652471
}
24662472
return this;
24672473
},
2474+
onskip: function(providedCallback) {
2475+
if (typeof (providedCallback) === 'function') {
2476+
this._introSkipCallback = providedCallback;
2477+
} else {
2478+
throw new Error('Provided callback for onskip was not a function.');
2479+
}
2480+
return this;
2481+
},
24682482
onbeforeexit: function(providedCallback) {
24692483
if (typeof (providedCallback) === 'function') {
24702484
this._introBeforeExitCallback = providedCallback;

0 commit comments

Comments
 (0)