Skip to content

Commit

Permalink
fix(timeslider): show single slider when there is no main range (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
KatvonRivia authored Oct 15, 2020
1 parent b0285b3 commit 92ff0f7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/scripts/components/layers/time-slider/time-slider.styl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ compareThumb()
.input::-ms-thumb
thumb()

.singleInput
height: 50px

.compareInput::-webkit-slider-thumb
compareThumb()

Expand All @@ -103,6 +106,9 @@ compareThumb()
top: 50px
transform: translate(0, 0)

.singleOutput
top: 40px

.playButton
margin-top: emCalc(-21px)
padding-right: 1em
Expand Down
10 changes: 7 additions & 3 deletions src/scripts/components/layers/time-slider/time-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ const TimeSlider: FunctionComponent<Props> = ({className = ''}) => {

const inputStyles = cx(
styles.input,
rangeMain && rangeCompare && styles.compareInput
rangeMain && rangeCompare && styles.compareInput,
!rangeMain && rangeCompare && styles.singleInput
);

const classes = cx(styles.timeSlider, className);

return (
Expand Down Expand Up @@ -188,7 +188,11 @@ const TimeSlider: FunctionComponent<Props> = ({className = ''}) => {

{rangeCompare && (
<output
className={cx(styles.timeOutput, styles.timeOutputCompare)}
className={cx(
styles.timeOutput,
styles.timeOutputCompare,
!rangeMain && rangeCompare && styles.singleOutput
)}
style={{
left: `${clampedLabelPosition}%`
}}>
Expand Down

0 comments on commit 92ff0f7

Please sign in to comment.