|
434 | 434 | q.to = filter ( q.to, 0 ); |
435 | 435 |
|
436 | 436 | // Reverse the API for RTL sliders. |
437 | | - if ( o.direction ) { |
| 437 | + if ( o.direction && q.to[1].length ) { |
438 | 438 | q.to.reverse(); |
439 | 439 | } |
440 | 440 |
|
|
718 | 718 | // add the proper events to them or create new input fields, |
719 | 719 | // and add them as data to the handle so they can be kept |
720 | 720 | // in sync with the slider value. |
721 | | - $.each( serialization.to[i], function(){ |
722 | | - elements = elements.concat( storeElement( handle, this, i ) ); |
| 721 | + $.each( serialization.to[i], function( index ){ |
| 722 | + elements = elements.concat( |
| 723 | + storeElement( handle, serialization.to[i][index], i ) |
| 724 | + ); |
723 | 725 | }); |
724 | 726 |
|
725 | 727 | return { |
|
902 | 904 | // other function. Base is the internal main 'bar'. |
903 | 905 | var target = $(this).addClass(clsList[6]), i, handle, |
904 | 906 | base = $('<div/>').appendTo(target), |
| 907 | + d = options.direction, |
905 | 908 | classes = { |
906 | 909 | base: [ clsList[0] ] |
907 | 910 | ,origin: [ |
908 | | - [ clsList[1], clsList[1] + clsList[7] ] |
909 | | - ,[ clsList[1], clsList[1] + clsList[8] ] |
| 911 | + [ clsList[1], clsList[1] + clsList[d?8:7] ] |
| 912 | + ,[ clsList[1], clsList[1] + clsList[d?7:8] ] |
910 | 913 | ] |
911 | 914 | ,handle: [ |
912 | | - [ clsList[2], clsList[2] + clsList[7] ] |
913 | | - ,[ clsList[2], clsList[2] + clsList[8] ] |
| 915 | + [ clsList[2], clsList[2] + clsList[d?8:7] ] |
| 916 | + ,[ clsList[2], clsList[2] + clsList[d?7:8] ] |
914 | 917 | ] |
915 | 918 | }; |
916 | 919 |
|
|
920 | 923 | // renaming and provide a minor compression benefit. |
921 | 924 | if( options.connect ) { |
922 | 925 |
|
| 926 | + if ( d ) { |
| 927 | + |
| 928 | + if ( options.connect === 'lower' ) { |
| 929 | + options.connect = 'upper'; |
| 930 | + } else if ( options.connect === 'upper' ) { |
| 931 | + options.connect = 'lower'; |
| 932 | + } |
| 933 | + } |
| 934 | + |
923 | 935 | if( options.connect === 'lower' ){ |
924 | 936 | // Add some styling classes to the base; |
925 | 937 | classes.base.push(clsList[9], clsList[9] + clsList[7]); |
|
953 | 965 | classes.base.push(clsList[11]); |
954 | 966 | } |
955 | 967 |
|
956 | | - if ( options.direction ) { |
957 | | - target.addClass(clsList[16]); |
958 | | - } |
959 | | - |
960 | 968 | // Merge base classes with default, |
961 | 969 | // and store relevant data on the base element. |
962 | 970 | base.addClass( classes.base.join(' ') ).data({ |
|
968 | 976 | // Make data accessible in functions throughout the plugin. |
969 | 977 | target.data('base', base); |
970 | 978 |
|
| 979 | + if ( d ) { |
| 980 | + target.addClass(clsList[16]); |
| 981 | + } |
| 982 | + |
971 | 983 | for (i = 0; i < options.handles; i++ ) { |
972 | 984 |
|
973 | 985 | handle = $('<div><div/></div>').appendTo(base); |
|
0 commit comments