Browse Source

fixed custom step. Added in hover variation.

pull/4212/head
Gareth Daunton 8 years ago
parent
commit
c659ad30cf
3 changed files with 21 additions and 1 deletions
  1. 2
      src/definitions/modules/range.js
  2. 14
      src/definitions/modules/range.less
  3. 6
      src/themes/default/modules/range.variables

2
src/definitions/modules/range.js

@ -108,7 +108,7 @@ $.fn.range = function(parameters) {
var var
ratio = (currentPos - startPos) / (endPos - startPos), ratio = (currentPos - startPos) / (endPos - startPos),
range = settings.max - settings.min, range = settings.max - settings.min,
difference = Math.round((ratio * range / step) * step)
difference = Math.round(ratio * range / step) * step
; ;
// Use precision to avoid ugly Javascript floating point rounding issues // Use precision to avoid ugly Javascript floating point rounding issues
// (like 35 * .01 = 0.35000000000000003) // (like 35 * .01 = 0.35000000000000003)

14
src/definitions/modules/range.less

@ -98,6 +98,20 @@
Variations Variations
*******************************/ *******************************/
/*--------------
Hover
---------------*/
.ui.hover.range .inner .thumb {
opacity: @hoverVarOpacity;
transition: @hoverOpacityTransition;
}
.ui.hover.range .inner:hover .thumb {
opacity: @hoverVarHoverOpacity;
}
/*-------------- /*--------------
Inverted Inverted

6
src/themes/default/modules/range.variables

@ -49,6 +49,12 @@
Variations Variations
--------------------*/ --------------------*/
/* Hover */
@hoverVarOpacity : 0;
@hoverVarHoverOpacity : 1;
@hoverOpacityTransitionDuration : 0.2s;
@hoverOpacityTransition : opacity @hoverOpacityTransitionDuration linear;
/* Sizing */ /* Sizing */
@smallHeight : 1em; @smallHeight : 1em;
@smallTrackHeight : 0.3em; @smallTrackHeight : 0.3em;

Loading…
Cancel
Save