Skip to content

Commit 0b4a789

Browse files
committed
Connect for RTL, string fix in IE8, removed test.
Ready for commit
1 parent 8e539ab commit 0b4a789

File tree

3 files changed

+26
-525
lines changed

3 files changed

+26
-525
lines changed

jquery.nouislider.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
}
1919

2020
/* Main slider bar;
21-
* Use outline instead of border to keep absolute
21+
* Use box-shadow instead of border to keep absolute
2222
* positioning unrelated to the styling.
2323
*/
2424
.noUi-base {
2525
width: 100%;
2626
margin: 1px;
2727
height: 38px;
2828
position: relative;
29-
outline: 1px solid #BFBFBF;
29+
box-shadow: 0 0 0 1px #BFBFBF;
3030
}
3131

3232
/* Handles + active state;
@@ -71,7 +71,7 @@
7171
bottom: 0;
7272
border-radius: inherit;
7373
}
74-
.noUi-origin-upper {
74+
.noUi-origin + .noUi-origin {
7575
background: inherit !important;
7676
}
7777
.noUi-z-index {

jquery.nouislider.js

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@
434434
q.to = filter ( q.to, 0 );
435435

436436
// Reverse the API for RTL sliders.
437-
if ( o.direction ) {
437+
if ( o.direction && q.to[1].length ) {
438438
q.to.reverse();
439439
}
440440

@@ -718,8 +718,10 @@
718718
// add the proper events to them or create new input fields,
719719
// and add them as data to the handle so they can be kept
720720
// 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+
);
723725
});
724726

725727
return {
@@ -902,15 +904,16 @@
902904
// other function. Base is the internal main 'bar'.
903905
var target = $(this).addClass(clsList[6]), i, handle,
904906
base = $('<div/>').appendTo(target),
907+
d = options.direction,
905908
classes = {
906909
base: [ clsList[0] ]
907910
,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] ]
910913
]
911914
,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] ]
914917
]
915918
};
916919

@@ -920,6 +923,15 @@
920923
// renaming and provide a minor compression benefit.
921924
if( options.connect ) {
922925

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+
923935
if( options.connect === 'lower' ){
924936
// Add some styling classes to the base;
925937
classes.base.push(clsList[9], clsList[9] + clsList[7]);
@@ -953,10 +965,6 @@
953965
classes.base.push(clsList[11]);
954966
}
955967

956-
if ( options.direction ) {
957-
target.addClass(clsList[16]);
958-
}
959-
960968
// Merge base classes with default,
961969
// and store relevant data on the base element.
962970
base.addClass( classes.base.join(' ') ).data({
@@ -968,6 +976,10 @@
968976
// Make data accessible in functions throughout the plugin.
969977
target.data('base', base);
970978

979+
if ( d ) {
980+
target.addClass(clsList[16]);
981+
}
982+
971983
for (i = 0; i < options.handles; i++ ) {
972984

973985
handle = $('<div><div/></div>').appendTo(base);

0 commit comments

Comments
 (0)