From cdd5d27908ce1556d8868daa89005b527cfffbfa Mon Sep 17 00:00:00 2001 From: orangemug Date: Tue, 30 Oct 2018 20:35:22 +0000 Subject: [PATCH] Added range slider to --- src/components/inputs/NumberInput.jsx | 44 +++++++++++++++++++++----- src/components/layers/MaxZoomBlock.jsx | 1 + src/components/layers/MinZoomBlock.jsx | 1 + 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/components/inputs/NumberInput.jsx b/src/components/inputs/NumberInput.jsx index 75ed148..e4fb221 100644 --- a/src/components/inputs/NumberInput.jsx +++ b/src/components/inputs/NumberInput.jsx @@ -68,14 +68,42 @@ class NumberInput extends React.Component { } render() { - return this.changeValue(e.target.value)} - onBlur={this.resetValue} - /> + let rangeEl; + + if( + this.props.hasOwnProperty("min") && this.props.hasOwnProperty("max") && + this.props.min !== undefined && this.props.max !== undefined && + this.props.allowRange + ) { + rangeEl = ( + this.changeValue(e.target.value)} + onBlur={this.resetValue} + /> + ); + } + + return
+ {rangeEl} + this.changeValue(e.target.value)} + onBlur={this.resetValue} + /> +
} } diff --git a/src/components/layers/MaxZoomBlock.jsx b/src/components/layers/MaxZoomBlock.jsx index b4ab33e..7447593 100644 --- a/src/components/layers/MaxZoomBlock.jsx +++ b/src/components/layers/MaxZoomBlock.jsx @@ -16,6 +16,7 @@ class MaxZoomBlock extends React.Component { data-wd-key="max-zoom" >