Made something way to complicated when it can be achieved oh so much easier.
Thanks @Salandora
This commit is contained in:
parent
06518b5374
commit
4944c33228
1 changed files with 1 additions and 1 deletions
|
|
@ -181,7 +181,7 @@ $(function() {
|
||||||
// if default value is not within range of min and max, correct that
|
// if default value is not within range of min and max, correct that
|
||||||
if (!_.inRange(defaultValue, element.slider.min, element.slider.max)) {
|
if (!_.inRange(defaultValue, element.slider.min, element.slider.max)) {
|
||||||
// use bound closer to configured default value
|
// use bound closer to configured default value
|
||||||
defaultValue = (Math.abs(element.slider.min - defaultValue) < Math.abs(element.slider.max - defaultValue)) ? element.slider.min : element.slider.max;
|
defaultValue = defaultValue < element.slider.min ? element.slider.min : element.slider.max;
|
||||||
}
|
}
|
||||||
|
|
||||||
element.value = ko.observable(defaultValue);
|
element.value = ko.observable(defaultValue);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue