@@ -9,7 +9,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
9
9
function _typeof ( obj ) { "@babel/helpers - typeof" ; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol . iterator ? function ( obj ) { return typeof obj ; } : function ( obj ) { return obj && "function" == typeof Symbol && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } , _typeof ( obj ) ; }
10
10
11
11
/*!
12
- * jQuery SmartWizard v6.0.1
12
+ * jQuery SmartWizard v6.0.3
13
13
* The awesome step wizard plugin for jQuery
14
14
* http://www.techlaboratory.net/jquery-smartwizard
15
15
*
@@ -51,7 +51,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
51
51
selected : 0 ,
52
52
// Initial selected step, 0 = first step
53
53
theme : 'basic' ,
54
- // theme for the wizard, related css need to include for other than default theme
54
+ // Theme for the wizard, related css need to include for other than default theme
55
55
justified : true ,
56
56
// Nav menu justification. true/false
57
57
autoAdjustHeight : true ,
@@ -282,12 +282,12 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
282
282
value : function _setElements ( ) {
283
283
var _this2 = this ;
284
284
285
- // Set the main element
286
- this . main . addClass ( this . options . style . mainCss ) ; // Set theme option
287
-
285
+ // Set theme option
288
286
this . main . removeClass ( function ( i , className ) {
289
- return ( className . match ( / ( ^ | \s ) s w - t h e m e - \S + / g) || [ ] ) . join ( ' ' ) ;
290
- } ) . addClass ( this . options . style . themePrefixCss + this . options . theme ) ; // Set justify option
287
+ return ( className . match ( new RegExp ( '(^|\\s)' + _this2 . options . style . themePrefixCss + '\\S+' , 'g' ) ) || [ ] ) . join ( ' ' ) ;
288
+ } ) . addClass ( this . options . style . themePrefixCss + this . options . theme ) ; // Set the main element
289
+
290
+ this . main . addClass ( this . options . style . mainCss ) . addClass ( this . options . style . themePrefixCss + this . options . theme ) ; // Set justify option
291
291
292
292
this . main . toggleClass ( this . options . style . justifiedCss , this . options . justified ) ; // Set the anchor default style
293
293
@@ -442,20 +442,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
442
442
443
443
444
444
_this4 . _transit ( selPage , curPage , stepDirection , function ( ) {
445
- // Update the current index
446
- _this4 . current_index = idx ; // Fix height with content
445
+ // Fix height with content
446
+ _this4 . _fixHeight ( idx ) ; // Trigger "showStep" event
447
447
448
- _this4 . _fixHeight ( idx ) ; // Set the buttons based on the step
449
448
449
+ _this4 . _triggerEvent ( "showStep" , [ selStep , idx , stepDirection , _this4 . _getStepPosition ( idx ) ] ) ;
450
+ } ) ; // Update the current index
450
451
451
- _this4 . _setButtons ( idx ) ; // Set the progressbar based on the step
452
452
453
+ _this4 . current_index = idx ; // Set the buttons based on the step
453
454
454
- _this4 . _setProgressbar ( idx ) ; // Trigger "showStep" event
455
+ _this4 . _setButtons ( idx ) ; // Set the progressbar based on the step
455
456
456
457
457
- _this4 . _triggerEvent ( "showStep" , [ selStep , idx , stepDirection , _this4 . _getStepPosition ( idx ) ] ) ;
458
- } ) ;
458
+ _this4 . _setProgressbar ( idx ) ;
459
459
} ) ;
460
460
}
461
461
} , {
@@ -560,6 +560,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
560
560
value : function _transit ( elmToShow , elmToHide , stepDirection , callback ) {
561
561
var transitFn = $ . fn . smartWizard . transitions [ this . options . transition . animation ] ;
562
562
563
+ this . _stopAnimations ( ) ;
564
+
563
565
if ( $ . isFunction ( transitFn ) ) {
564
566
transitFn ( elmToShow , elmToHide , stepDirection , this , function ( res ) {
565
567
if ( res === false ) {
@@ -575,6 +577,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
575
577
callback ( ) ;
576
578
}
577
579
}
580
+ } , {
581
+ key : "_stopAnimations" ,
582
+ value : function _stopAnimations ( ) {
583
+ if ( $ . isFunction ( this . container . finish ) ) {
584
+ this . pages . finish ( ) ;
585
+ this . container . finish ( ) ;
586
+ }
587
+ }
578
588
} , {
579
589
key : "_fixHeight" ,
580
590
value : function _fixHeight ( idx ) {
@@ -596,19 +606,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
596
606
key : "_setAnchor" ,
597
607
value : function _setAnchor ( idx ) {
598
608
// Current step anchor > Remove other classes and add done class
599
- this . steps . eq ( this . current_index ) . removeClass ( this . options . style . anchorActiveCss ) ;
609
+ if ( this . current_index !== null && this . current_index >= 0 ) {
610
+ var removeCss = this . options . style . anchorActiveCss ;
611
+ var addCss = '' ;
600
612
601
- if ( this . options . anchor . enableDoneState !== false && this . current_index !== null && this . current_index >= 0 ) {
602
- this . steps . eq ( this . current_index ) . addClass ( this . options . style . anchorDoneCss ) ;
613
+ if ( this . options . anchor . enableDoneState !== false ) {
614
+ addCss += this . options . style . anchorDoneCss ;
603
615
604
- if ( this . options . anchor . unDoneOnBackNavigation !== false && this . _getStepDirection ( idx ) === 'backward' ) {
605
- this . steps . eq ( this . current_index ) . removeClass ( this . options . style . anchorDoneCss ) ;
616
+ if ( this . options . anchor . unDoneOnBackNavigation !== false && this . _getStepDirection ( idx ) === 'backward' ) {
617
+ removeCss += ' ' + this . options . style . anchorDoneCss ;
618
+ }
606
619
}
620
+
621
+ this . steps . eq ( this . current_index ) . removeClass ( removeCss ) . addClass ( addCss ) ;
607
622
} // Next step anchor > Remove other classes and add active class
608
623
609
624
610
- this . steps . eq ( idx ) . removeClass ( this . options . style . anchorDoneCss ) ;
611
- this . steps . eq ( idx ) . addClass ( this . options . style . anchorActiveCss ) ;
625
+ this . steps . eq ( idx ) . removeClass ( this . options . style . anchorDoneCss ) . addClass ( this . options . style . anchorActiveCss ) ;
612
626
}
613
627
} , {
614
628
key : "_setButtons" ,
0 commit comments