This repository was archived by the owner on Feb 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 159
159
* @method _nextStep
160
160
*/
161
161
function _nextStep ( ) {
162
+ if ( typeof ( this . _introBeforeChangeCallback ) !== 'undefined' ) {
163
+ this . _introBeforeChangeCallback . call ( this , this . _targetElement ) ;
164
+ }
165
+
162
166
if ( typeof ( this . _currentStep ) === 'undefined' ) {
163
167
this . _currentStep = 0 ;
164
168
} else {
189
193
return false ;
190
194
}
191
195
196
+ if ( typeof ( this . _introBeforeChangeCallback ) !== 'undefined' ) {
197
+ this . _introBeforeChangeCallback . call ( this , this . _targetElement ) ;
198
+ }
199
+
192
200
_showElement . call ( this , this . _introItems [ -- this . _currentStep ] ) ;
193
201
}
194
202
702
710
exit : function ( ) {
703
711
_exitIntro . call ( this , this . _targetElement ) ;
704
712
} ,
713
+ onbeforechange : function ( providedCallback ) {
714
+ if ( typeof ( providedCallback ) === 'function' ) {
715
+ this . _introBeforeChangeCallback = providedCallback ;
716
+ } else {
717
+ throw new Error ( 'Provided callback for onbeforechange was not a function' ) ;
718
+ }
719
+ return this ;
720
+ } ,
705
721
onchange : function ( providedCallback ) {
706
722
if ( typeof ( providedCallback ) === 'function' ) {
707
723
this . _introChangeCallback = providedCallback ;
You can’t perform that action at this time.
0 commit comments