Fix slider value when clicking track

The slider value showed the previous value from when the user last dragged or clicked the slider track or handle.
Moved the value caculation to be before using it to generate the tooltip text.
Merge pull request #1 from ZhihaoJia/slider-click

Fix slider value when clicking track