The slider works fine for an integer field. However, the step-size is dynamically calculated according to a piece of php logic around line 73 in widget_slider.inc.

The threshold is hardcoded to 20 in there. I guess this is done to provide fine-grained control if the range is small? But when you are using integers you don't want the slider to display calues like 5,4.

I solved this by replacing the hardcoded 20 with a variable. Even better would be to provide a config UI for this maybe.

Around line 73 in widget_slider.inc:

        if ($slider_max - $slider_min < variable_get('facetapi_slider_sliderstep_threshold', 20)) {
          $this->jsSettings['sliderStep'] = ($slider_max - $slider_min) / variable_get('facetapi_slider_sliderstep_threshold', 20);
        }
        else {
          $this->jsSettings['sliderStep'] = 1;
        }

Comments

nick_vh’s picture

Status: Active » Closed (duplicate)