From c659ad30cfa8067b68185879035772e6c29a2a28 Mon Sep 17 00:00:00 2001 From: Gareth Daunton Date: Sun, 3 Jul 2016 17:25:04 -0400 Subject: [PATCH] fixed custom step. Added in hover variation. --- src/definitions/modules/range.js | 2 +- src/definitions/modules/range.less | 14 ++++++++++++++ src/themes/default/modules/range.variables | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/definitions/modules/range.js b/src/definitions/modules/range.js index ce4e7d907..28e16576f 100644 --- a/src/definitions/modules/range.js +++ b/src/definitions/modules/range.js @@ -108,7 +108,7 @@ $.fn.range = function(parameters) { var ratio = (currentPos - startPos) / (endPos - startPos), 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 // (like 35 * .01 = 0.35000000000000003) diff --git a/src/definitions/modules/range.less b/src/definitions/modules/range.less index a51963ca0..4432dfccd 100644 --- a/src/definitions/modules/range.less +++ b/src/definitions/modules/range.less @@ -98,6 +98,20 @@ Variations *******************************/ +/*-------------- + Hover +---------------*/ + +.ui.hover.range .inner .thumb { + opacity: @hoverVarOpacity; + transition: @hoverOpacityTransition; +} + +.ui.hover.range .inner:hover .thumb { + opacity: @hoverVarHoverOpacity; +} + + /*-------------- Inverted diff --git a/src/themes/default/modules/range.variables b/src/themes/default/modules/range.variables index 410b64cf7..0223215fc 100644 --- a/src/themes/default/modules/range.variables +++ b/src/themes/default/modules/range.variables @@ -49,6 +49,12 @@ Variations --------------------*/ +/* Hover */ +@hoverVarOpacity : 0; +@hoverVarHoverOpacity : 1; +@hoverOpacityTransitionDuration : 0.2s; +@hoverOpacityTransition : opacity @hoverOpacityTransitionDuration linear; + /* Sizing */ @smallHeight : 1em; @smallTrackHeight : 0.3em;