]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commit
Adds pow and log transforms to the Slider component
authorMaarten Brouwers <github.com@murb.nl>
Tue, 1 Nov 2016 16:59:08 +0000 (17:59 +0100)
committerMaarten Brouwers <github.com@murb.nl>
Tue, 1 Nov 2016 16:59:08 +0000 (17:59 +0100)
commitbe69656e88597dc393ae28400d25f6e7ca8593d2
tree791fd80484b15434a239634f14ecce239605e10d
parent91092ea7c31130ada13b3642df4624b5572dd093
Adds pow and log transforms to the Slider component

Introduces two settings, `nonLinearBase` and `positionValueFunction` which change the way in which the position of the slider is translated to an actual value.

Besides the default value of â€˜linear' for `positionValueFunction`, 'pow' and a 'log' can be used.

*Example application*

In example below we want to focus on the most recent years, hence we use a logarithmic transformation of the slider:

          <div class="slider" data-slider data-initial-start="2010" data-initial-end="2015" data-step="1" data-start="1950" data-end="2016" data-position-value-function="log">
            <span class="slider-handle" data-slider-handle role="slider" tabindex="1" aria-controls="car_search_year_from"></span>
            <span class="slider-fill" data-slider-fill></span>
            <span class="slider-handle" data-slider-handle role="slider" tabindex="1" aria-controls="car_search_year_to"></span>
          </div>

Since I didn't get the test-framework to run I submitting this for now without tests, if it is absolutely necessary to do so, and this functionality is desired, allow me some time to fix that.
js/foundation.slider.js