Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.5
-
Fix Version/s: 1.8.4
-
Component/s: ZendX_JQuery
-
Labels:None
Description
When adding a JQuery slider form element, the slider will reset itself to 0 when the 'change' event is called. The fault line is
$sliderUpdateFn .= sprintf(' %s("#%s").attr("value", %s("#%s-slider").slider("value", %d));'.PHP_EOL,
when the last %d is simply removed, the bug doesn't repeat itself and everyone is happy!
$sliderUpdateFn .= sprintf(' %s("#%s").attr("value", %s("#%s-slider").slider("value"));'.PHP_EOL,
I actually don't know why that last %d is there as it is replaced by the handle index ($i) in the for... loop.
...or perhaps I am missing the point, but removing the last %d surely solve this problem.
An update ot the API, .slider("value", 0) sets the slider to 0 and return it (0). While .slider("value") simply returns the slider value.
Moreover, the line mentionned above may be replaced by this one
$sliderUpdateFn .= sprintf(' %s("#%s").attr("value", ui.value);'.PHP_EOL,which is clearer and cleaner.
$sliderUpdateFn .= sprintf(' %s("#%s").attr("value", ui.value);'.PHP_EOL,