1
1
/*!
2
- * jquery-steps v1.0.0pre - 08/11 /2013
2
+ * jquery-steps v1.0.0pre - 08/13 /2013
3
3
* Copyright (c) 2013 Rafael J. Staib (http://www.jquery-steps.com)
4
4
* Licensed under MIT http://www.opensource.org/licenses/MIT
5
5
*/
@@ -576,12 +576,12 @@ function loadAsyncContent(wizard, options, state)
576
576
break ;
577
577
578
578
case contentMode . async :
579
- var currentStepContent = getStepPanel ( wizard , state . currentIndex ) . aria ( "busy" , "true" )
579
+ var currentStepContent = getStepPanel ( wizard , state . currentIndex ) . _aria ( "busy" , "true" )
580
580
. empty ( ) . append ( renderTemplate ( options . loadingTemplate , { text : options . labels . loading } ) ) ;
581
581
582
582
$ . ajax ( { url : currentStep . contentUrl , cache : false } ) . done ( function ( data )
583
583
{
584
- currentStepContent . empty ( ) . html ( data ) . aria ( "busy" , "false" ) . data ( "loaded" , "1" ) ;
584
+ currentStepContent . empty ( ) . html ( data ) . _aria ( "busy" , "false" ) . data ( "loaded" , "1" ) ;
585
585
} ) ;
586
586
break ;
587
587
}
@@ -612,14 +612,14 @@ function paginationClick(wizard, options, state, index)
612
612
isDisabled = parent . hasClass ( "disabled" ) ;
613
613
614
614
// Enable the step to make the anchor clickable!
615
- parent . enableAria ( ) ;
615
+ parent . _enableAria ( ) ;
616
616
anchor . click ( ) ;
617
617
618
618
// An error occured
619
619
if ( oldIndex === state . currentIndex && isDisabled )
620
620
{
621
621
// Disable the step again if current index has not changed; prevents click action.
622
- parent . disableAria ( ) ;
622
+ parent . _disableAria ( ) ;
623
623
return false ;
624
624
}
625
625
@@ -685,52 +685,52 @@ function refreshPagination(wizard, options, state)
685
685
var previous = wizard . find ( ".actions a[href$='#previous']" ) . parent ( ) ;
686
686
if ( state . currentIndex > 0 )
687
687
{
688
- previous . enableAria ( ) ;
688
+ previous . _enableAria ( ) ;
689
689
}
690
690
else
691
691
{
692
- previous . disableAria ( ) ;
692
+ previous . _disableAria ( ) ;
693
693
}
694
694
}
695
695
696
696
if ( options . enableFinishButton && options . showFinishButtonAlways )
697
697
{
698
698
if ( state . stepCount === 0 )
699
699
{
700
- finish . disableAria ( ) ;
701
- next . disableAria ( ) ;
700
+ finish . _disableAria ( ) ;
701
+ next . _disableAria ( ) ;
702
702
}
703
703
else if ( state . stepCount > 1 && state . stepCount > ( state . currentIndex + 1 ) )
704
704
{
705
- finish . enableAria ( ) ;
706
- next . enableAria ( ) ;
705
+ finish . _enableAria ( ) ;
706
+ next . _enableAria ( ) ;
707
707
}
708
708
else
709
709
{
710
- finish . enableAria ( ) ;
711
- next . disableAria ( ) ;
710
+ finish . _enableAria ( ) ;
711
+ next . _disableAria ( ) ;
712
712
}
713
713
}
714
714
else
715
715
{
716
716
if ( state . stepCount === 0 )
717
717
{
718
- finish . hideAria ( ) ;
719
- next . showAria ( ) . disableAria ( ) ;
718
+ finish . _hideAria ( ) ;
719
+ next . _showAria ( ) . _disableAria ( ) ;
720
720
}
721
721
else if ( state . stepCount > ( state . currentIndex + 1 ) )
722
722
{
723
- finish . hideAria ( ) ;
724
- next . showAria ( ) . enableAria ( ) ;
723
+ finish . _hideAria ( ) ;
724
+ next . _showAria ( ) . _enableAria ( ) ;
725
725
}
726
726
else if ( ! options . enableFinishButton )
727
727
{
728
- next . disableAria ( ) ;
728
+ next . _disableAria ( ) ;
729
729
}
730
730
else
731
731
{
732
- finish . showAria ( ) ;
733
- next . hideAria ( ) ;
732
+ finish . _showAria ( ) ;
733
+ next . _hideAria ( ) ;
734
734
}
735
735
}
736
736
}
@@ -756,13 +756,13 @@ function refreshStepNavigation(wizard, options, state, oldIndex)
756
756
if ( oldIndex != null )
757
757
{
758
758
var oldStepAnchor = getStepAnchor ( wizard , oldIndex ) ;
759
- oldStepAnchor . parent ( ) . addClass ( "done" ) . removeClass ( "error" ) . deselectAria ( ) ;
759
+ oldStepAnchor . parent ( ) . addClass ( "done" ) . removeClass ( "error" ) . _deselectAria ( ) ;
760
760
stepTitles . eq ( oldIndex ) . removeClass ( "current" ) . next ( ".body" ) . removeClass ( "current" ) ;
761
761
currentInfo = oldStepAnchor . find ( ".current-info" ) ;
762
762
currentOrNewStepAnchor . focus ( ) ;
763
763
}
764
764
765
- currentOrNewStepAnchor . prepend ( currentInfo ) . parent ( ) . selectAria ( ) . removeClass ( "done" ) . enableAria ( ) ;
765
+ currentOrNewStepAnchor . prepend ( currentInfo ) . parent ( ) . _selectAria ( ) . removeClass ( "done" ) . _enableAria ( ) ;
766
766
stepTitles . eq ( state . currentIndex ) . addClass ( "current" ) . next ( ".body" ) . addClass ( "current" ) ;
767
767
}
768
768
@@ -786,13 +786,13 @@ function refreshSteps(wizard, options, state, index)
786
786
var uniqueStepId = uniqueId + _tabSuffix + i ,
787
787
uniqueBodyId = uniqueId + _tabpanelSuffix + i ,
788
788
uniqueHeaderId = uniqueId + _titleSuffix + i ,
789
- title = wizard . find ( ".title" ) . eq ( i ) . setId ( uniqueHeaderId ) ;
789
+ title = wizard . find ( ".title" ) . eq ( i ) . _setId ( uniqueHeaderId ) ;
790
790
791
- wizard . find ( ".steps a" ) . eq ( i ) . setId ( uniqueStepId )
792
- . aria ( "controls" , uniqueBodyId ) . attr ( "href" , "#" + uniqueHeaderId )
791
+ wizard . find ( ".steps a" ) . eq ( i ) . _setId ( uniqueStepId )
792
+ . _aria ( "controls" , uniqueBodyId ) . attr ( "href" , "#" + uniqueHeaderId )
793
793
. html ( renderTemplate ( options . titleTemplate , { index : i + 1 , title : title . html ( ) } ) ) ;
794
- wizard . find ( ".body" ) . eq ( i ) . setId ( uniqueBodyId )
795
- . aria ( "labelledby" , uniqueHeaderId ) ;
794
+ wizard . find ( ".body" ) . eq ( i ) . _setId ( uniqueBodyId )
795
+ . _aria ( "labelledby" , uniqueHeaderId ) ;
796
796
}
797
797
}
798
798
@@ -899,7 +899,7 @@ function render(wizard, options, state)
899
899
} ) ;
900
900
901
901
// Make the start step visible
902
- stepContents . eq ( state . currentIndex ) . showAria ( ) ;
902
+ stepContents . eq ( state . currentIndex ) . _showAria ( ) ;
903
903
904
904
stepTitles . each ( function ( index )
905
905
{
@@ -926,8 +926,8 @@ function renderBody(wizard, body, index)
926
926
uniqueBodyId = uniqueId + _tabpanelSuffix + index ,
927
927
uniqueHeaderId = uniqueId + _titleSuffix + index ;
928
928
929
- body . setId ( uniqueBodyId ) . attr ( "role" , "tabpanel" ) . aria ( "labelledby" , uniqueHeaderId )
930
- . addClass ( "body" ) . hideAria ( ) ;
929
+ body . _setId ( uniqueBodyId ) . attr ( "role" , "tabpanel" ) . _aria ( "labelledby" , uniqueHeaderId )
930
+ . addClass ( "body" ) . _hideAria ( ) ;
931
931
}
932
932
933
933
/**
@@ -1025,15 +1025,15 @@ function renderTitle(wizard, options, state, header, index)
1025
1025
1026
1026
if ( ! options . enableAllSteps )
1027
1027
{
1028
- stepItem . disableAria ( ) ;
1028
+ stepItem . _disableAria ( ) ;
1029
1029
}
1030
1030
1031
1031
if ( state . currentIndex > index )
1032
1032
{
1033
- stepItem . enableAria ( ) . addClass ( "done" ) ;
1033
+ stepItem . _enableAria ( ) . addClass ( "done" ) ;
1034
1034
}
1035
1035
1036
- header . setId ( uniqueHeaderId ) . attr ( "tabindex" , "-1" ) . addClass ( "title" ) ;
1036
+ header . _setId ( uniqueHeaderId ) . attr ( "tabindex" , "-1" ) . addClass ( "title" ) ;
1037
1037
1038
1038
if ( index === 0 )
1039
1039
{
@@ -1096,14 +1096,14 @@ function startTransitionEffect(wizard, options, state, index, oldIndex)
1096
1096
state . transitionElement = newStep ;
1097
1097
currentStep [ hide ] ( effectSpeed , function ( )
1098
1098
{
1099
- var wizard = $ ( this ) . hideAria ( ) . parents ( ":has(.steps)" ) ,
1099
+ var wizard = $ ( this ) . _hideAria ( ) . parents ( ":has(.steps)" ) ,
1100
1100
state = getState ( wizard ) ;
1101
1101
1102
1102
if ( state . transitionElement )
1103
1103
{
1104
1104
state . transitionElement [ show ] ( effectSpeed , function ( )
1105
1105
{
1106
- $ ( this ) . showAria ( ) ;
1106
+ $ ( this ) . _showAria ( ) ;
1107
1107
} ) ;
1108
1108
state . transitionElement = null ;
1109
1109
}
@@ -1117,14 +1117,14 @@ function startTransitionEffect(wizard, options, state, index, oldIndex)
1117
1117
posLeft = currentStep . parent ( ) . position ( ) . left ;
1118
1118
1119
1119
currentStep . animate ( { left : posFadeOut } , effectSpeed ,
1120
- function ( ) { $ ( this ) . hideAria ( ) ; } ) . promise ( ) ;
1121
- newStep . css ( "left" , posFadeIn + "px" ) . showAria ( )
1120
+ function ( ) { $ ( this ) . _hideAria ( ) ; } ) . promise ( ) ;
1121
+ newStep . css ( "left" , posFadeIn + "px" ) . _showAria ( )
1122
1122
. animate ( { left : posLeft } , effectSpeed ) . promise ( ) ;
1123
1123
break ;
1124
1124
1125
1125
default :
1126
- currentStep . hideAria ( ) ;
1127
- newStep . showAria ( ) ;
1126
+ currentStep . _hideAria ( ) ;
1127
+ newStep . _showAria ( ) ;
1128
1128
break ;
1129
1129
}
1130
1130
}
@@ -1883,47 +1883,47 @@ var defaults = $.fn.steps.defaults = {
1883
1883
} ;
1884
1884
1885
1885
$ . fn . extend ( {
1886
- aria : function ( name , value )
1886
+ _aria : function ( name , value )
1887
1887
{
1888
1888
return this . attr ( "aria-" + name , value ) ;
1889
1889
} ,
1890
1890
1891
- removeAria : function ( name )
1891
+ _removeAria : function ( name )
1892
1892
{
1893
1893
return this . removeAttr ( "aria-" + name ) ;
1894
1894
} ,
1895
1895
1896
- enableAria : function ( )
1896
+ _enableAria : function ( )
1897
1897
{
1898
- return this . removeClass ( "disabled" ) . aria ( "disabled" , "false" ) ;
1898
+ return this . removeClass ( "disabled" ) . _aria ( "disabled" , "false" ) ;
1899
1899
} ,
1900
1900
1901
- disableAria : function ( )
1901
+ _disableAria : function ( )
1902
1902
{
1903
- return this . addClass ( "disabled" ) . aria ( "disabled" , "true" ) ;
1903
+ return this . addClass ( "disabled" ) . _aria ( "disabled" , "true" ) ;
1904
1904
} ,
1905
1905
1906
- hideAria : function ( )
1906
+ _hideAria : function ( )
1907
1907
{
1908
- return this . hide ( ) . aria ( "hidden" , "true" ) ;
1908
+ return this . hide ( ) . _aria ( "hidden" , "true" ) ;
1909
1909
} ,
1910
1910
1911
- showAria : function ( )
1911
+ _showAria : function ( )
1912
1912
{
1913
- return this . show ( ) . aria ( "hidden" , "false" ) ;
1913
+ return this . show ( ) . _aria ( "hidden" , "false" ) ;
1914
1914
} ,
1915
1915
1916
- selectAria : function ( )
1916
+ _selectAria : function ( )
1917
1917
{
1918
- return this . addClass ( "current" ) . aria ( "selected" , "true" ) ;
1918
+ return this . addClass ( "current" ) . _aria ( "selected" , "true" ) ;
1919
1919
} ,
1920
1920
1921
- deselectAria : function ( )
1921
+ _deselectAria : function ( )
1922
1922
{
1923
- return this . removeClass ( "current" ) . aria ( "selected" , "false" ) ;
1923
+ return this . removeClass ( "current" ) . _aria ( "selected" , "false" ) ;
1924
1924
} ,
1925
1925
1926
- setId : function ( id )
1926
+ _setId : function ( id )
1927
1927
{
1928
1928
return this . attr ( "id" , id ) ;
1929
1929
}
0 commit comments