Closed (duplicate)
Project:
Facetapi Slider
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2011 at 09:10 UTC
Updated:
27 Oct 2011 at 13:32 UTC
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
Comment #1
nick_vhDuplicate of #1322658: Prevent slider from showing float values for integer fields