Permalink
Browse files

fix(slider): set min max if they are null

  • Loading branch information...
Freihofner, Katrin Freihofner, Katrin
Freihofner, Katrin authored and Freihofner, Katrin committed Nov 11, 2016
1 parent 07dc7d7 commit 992174b6dcfd331771ee5370e63f2ce98948a8e1
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/slider/slider.js
@@ -1,10 +1,13 @@
import $ from '../js-common-components/dollar';

function colorRangeInput() {
this.min = this.min || 0;
this.max = this.max || 100;

const currentValue = ((this.value - this.min) / (this.max - this.min)) * 100;
this.style.backgroundImage =
`linear-gradient(to right, #00a1b2 0%, #00a1b2 ${currentValue}%,
#ccc ${currentValue}%, #ccc 100%)`;
`linear-gradient(to right, #00a1b2 0%, #00a1b2 ${currentValue}%,
#ccc ${currentValue}%, #ccc 100%)`;
}

const init = () => {

0 comments on commit 992174b

Please sign in to comment.