Skip to content

Commit

Permalink
Design fixes, out of range init.
Browse files Browse the repository at this point in the history
  • Loading branch information
leongersen committed Nov 28, 2013
1 parent ea80b7d commit 1352322
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
29 changes: 12 additions & 17 deletions jquery.nouislider.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,21 @@
width: 100%;
height: 100%;
position: relative;
background: inherit;
border-radius: inherit;
}
.noUi-origin {
position: absolute;
right: 0;
top: 0;
left: 0;
bottom: 0;
border-radius: inherit;
}
.noUi-origin + .noUi-origin {
/* Inherit the background styling from the target.
IE7 doesn't support inherit, so set a default. */
background: #FAFAFA;
background: inherit !important;
}
.noUi-handle {
position: relative;
z-index: 1;
}
.noUi-stacking .noUi-handle {
/* This class is applied to the lower origin when
its values is > 50%. */
z-index: 10;
}
.noUi-stacking + .noUi-origin {
Expand Down Expand Up @@ -99,11 +92,17 @@
-webkit-transition: background 450ms;
transition: background 450ms;
}
.noUi-origin {
border-radius: 2px;
}
.noUi-target {
border-radius: 4px;
border: 1px solid #D3D3D3;
box-shadow: inset 0 1px 1px #F0F0F0, 0 3px 6px -5px #BBB;
}
.noUi-target.noUi-connect {
box-shadow: inset 0 0 3px rgba(51,51,51,0.45), 0 3px 6px -5px #BBB;
}

/* Handles and cursors;
*/
Expand Down Expand Up @@ -138,25 +137,21 @@
height: 14px;
width: 1px;
background: #E8E7E6;
border-color: #FFF;
border-style: solid;
border-width: 0 0 0 1px;
left: 13px;
left: 14px;
top: 6px;
}
.noUi-handle:after {
left: 16px;
left: 17px;
}
.noUi-vertical .noUi-handle:before,
.noUi-vertical .noUi-handle:after {
width: 14px;
height: 1px;
left: 6px;
top: 13px;
border-width: 0 0 1px 0;
top: 14px;
}
.noUi-vertical .noUi-handle:after {
top: 16px;
top: 17px;
}

/* Disabled state;
Expand Down
10 changes: 6 additions & 4 deletions jquery.nouislider.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,9 @@
}
}

// Limit position to boundaries.
to = Math.min( Math.max( to, lower ), upper );
// Limit position to boundaries. When the handles aren't set yet,
// they return -1 as a percentage value.
to = Math.min( Math.max( to, lower ), upper < 0 ? 100 : upper );

// Stop handling this call if the handle can't move past another.
// Return an array containing the hit limit, so the caller can
Expand Down Expand Up @@ -1148,8 +1149,9 @@
case 1: target.addClass( clsList[9] );
handles[0].addClass( clsList[12] );
break;
case 2:
case 3: handles[0].addClass( clsList[9] );
case 3: handles[1].addClass( clsList[12] );
/* falls through */
case 2: handles[0].addClass( clsList[9] );
/* falls through */
case 0: target.addClass(clsList[12]);
break;
Expand Down

0 comments on commit 1352322

Please sign in to comment.