Commit e91edd90 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

luahttp: Don't interfere while the user is dragging

The updateStatus() function should not interrupt the user and reset his position while he is dragging the volume slider.

Close #6652
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent bc682655
......@@ -21,9 +21,12 @@ function updateStatus() {
value: toFloat($('position', data).text()) * 100
});
$('#currentVolume').append(Math.round($('volume', data).text() / 2.56) + '%');
$('#volumeSlider').slider({
value: ($('volume', data).text() / 5.12)
});
/* Don't interfere with the user's action */
if (!$('#volumeSlider').data('clicked')) {
$('#volumeSlider').slider({
value: ($('volume', data).text() / 5.12)
});
}
$('#rateSlider').slider({
value: ($('rate', data).text())
});
......
......@@ -24,14 +24,21 @@ $(function () {
value: 50,
min: 0,
max: 100,
start: function (event, ui) {
$("#volumeSlider").data( 'clicked', true );
},
stop: function (event, ui) {
$("#currentVolume").empty().append(ui.value * 2 + "%");
sendCommand({
'command': 'volume',
'val': Math.round(ui.value * 5.12)
})
$("#volumeSlider").data( 'clicked', false );
}
});
/* To ensure that updateStatus() doesn't interfere while use is
* sliding on the control. */
$("#volumeSlider").data( 'clicked', false );
$('#buttonStop').click(function () {
switch (current_que) {
case 'main':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment