@@ -9,7 +9,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
99function _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 ) ; }
1010
1111/*!
12- * jQuery SmartWizard v6.0.1
12+ * jQuery SmartWizard v6.0.5
1313* The awesome step wizard plugin for jQuery
1414* http://www.techlaboratory.net/jquery-smartwizard
1515*
@@ -51,7 +51,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5151 selected : 0 ,
5252 // Initial selected step, 0 = first step
5353 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
5555 justified : true ,
5656 // Nav menu justification. true/false
5757 autoAdjustHeight : true ,
@@ -282,12 +282,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
282282 value : function _setElements ( ) {
283283 var _this2 = this ;
284284
285- // Set the main element
286- this . main . addClass ( this . options . style . mainCss ) ; // Set theme option
287-
285+ // Set the main element classes including theme css
288286 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 . mainCss + ' ' + this . options . style . themePrefixCss + this . options . theme ) ; // Set justify option
291289
292290 this . main . toggleClass ( this . options . style . justifiedCss , this . options . justified ) ; // Set the anchor default style
293291
@@ -442,20 +440,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
442440
443441
444442 _this4 . _transit ( selPage , curPage , stepDirection , function ( ) {
445- // Update the current index
446- _this4 . current_index = idx ; // Fix height with content
443+ // Fix height with content
444+ _this4 . _fixHeight ( idx ) ; // Trigger "showStep" event
447445
448- _this4 . _fixHeight ( idx ) ; // Set the buttons based on the step
449446
447+ _this4 . _triggerEvent ( "showStep" , [ selStep , idx , stepDirection , _this4 . _getStepPosition ( idx ) ] ) ;
448+ } ) ; // Update the current index
450449
451- _this4 . _setButtons ( idx ) ; // Set the progressbar based on the step
452450
451+ _this4 . current_index = idx ; // Set the buttons based on the step
453452
454- _this4 . _setProgressbar ( idx ) ; // Trigger "showStep" event
453+ _this4 . _setButtons ( idx ) ; // Set the progressbar based on the step
455454
456455
457- _this4 . _triggerEvent ( "showStep" , [ selStep , idx , stepDirection , _this4 . _getStepPosition ( idx ) ] ) ;
458- } ) ;
456+ _this4 . _setProgressbar ( idx ) ;
459457 } ) ;
460458 }
461459 } , {
@@ -560,6 +558,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
560558 value : function _transit ( elmToShow , elmToHide , stepDirection , callback ) {
561559 var transitFn = $ . fn . smartWizard . transitions [ this . options . transition . animation ] ;
562560
561+ this . _stopAnimations ( ) ;
562+
563563 if ( $ . isFunction ( transitFn ) ) {
564564 transitFn ( elmToShow , elmToHide , stepDirection , this , function ( res ) {
565565 if ( res === false ) {
@@ -575,6 +575,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
575575 callback ( ) ;
576576 }
577577 }
578+ } , {
579+ key : "_stopAnimations" ,
580+ value : function _stopAnimations ( ) {
581+ if ( $ . isFunction ( this . container . finish ) ) {
582+ this . pages . finish ( ) ;
583+ this . container . finish ( ) ;
584+ }
585+ }
578586 } , {
579587 key : "_fixHeight" ,
580588 value : function _fixHeight ( idx ) {
@@ -596,19 +604,23 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
596604 key : "_setAnchor" ,
597605 value : function _setAnchor ( idx ) {
598606 // Current step anchor > Remove other classes and add done class
599- this . steps . eq ( this . current_index ) . removeClass ( this . options . style . anchorActiveCss ) ;
607+ if ( this . current_index !== null && this . current_index >= 0 ) {
608+ var removeCss = this . options . style . anchorActiveCss ;
609+ var addCss = '' ;
600610
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 ) ;
611+ if ( this . options . anchor . enableDoneState !== false ) {
612+ addCss += this . options . style . anchorDoneCss ;
603613
604- if ( this . options . anchor . unDoneOnBackNavigation !== false && this . _getStepDirection ( idx ) === 'backward' ) {
605- this . steps . eq ( this . current_index ) . removeClass ( this . options . style . anchorDoneCss ) ;
614+ if ( this . options . anchor . unDoneOnBackNavigation !== false && this . _getStepDirection ( idx ) === 'backward' ) {
615+ removeCss += ' ' + this . options . style . anchorDoneCss ;
616+ }
606617 }
618+
619+ this . steps . eq ( this . current_index ) . addClass ( addCss ) . removeClass ( removeCss ) ;
607620 } // Next step anchor > Remove other classes and add active class
608621
609622
610- this . steps . eq ( idx ) . removeClass ( this . options . style . anchorDoneCss ) ;
611- this . steps . eq ( idx ) . addClass ( this . options . style . anchorActiveCss ) ;
623+ this . steps . eq ( idx ) . removeClass ( this . options . style . anchorDoneCss ) . addClass ( this . options . style . anchorActiveCss ) ;
612624 }
613625 } , {
614626 key : "_setButtons" ,
0 commit comments