[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linterna-magica-commit] [294] Improved time and volume sliders behaviou
From: |
Ivaylo Valkov |
Subject: |
[linterna-magica-commit] [294] Improved time and volume sliders behaviour. |
Date: |
Sun, 15 Jul 2012 10:28:31 +0000 |
Revision: 294
http://svn.sv.gnu.org/viewvc/?view=rev&root=linterna-magica&revision=294
Author: valkov
Date: 2012-07-15 10:28:31 +0000 (Sun, 15 Jul 2012)
Log Message:
-----------
Improved time and volume sliders behaviour. It should be possible to set the
volume to 100%. Slide knobs are not able to move past the slider length. See
also bugs #36760. #future_release_0.0.13
Ticket Links:
------------
http://savannah.gnu.org/bugs/?36760
Modified Paths:
--------------
trunk/src/lm_player_button_functions.js
Modified: trunk/src/lm_player_button_functions.js
===================================================================
--- trunk/src/lm_player_button_functions.js 2012-07-15 09:49:57 UTC (rev
293)
+++ trunk/src/lm_player_button_functions.js 2012-07-15 10:28:31 UTC (rev
294)
@@ -807,9 +807,11 @@
}
// Limit position
- if ((position+knob.clientWidth) >= slider.clientWidth)
+ if ((position+knob.clientWidth) > slider.clientWidth)
{
- position = slider.clientWidth - knob.clientWidth;
+ if (direction > 0) {
+ position = slider.clientWidth - knob.clientWidth;
+ }
}
if (position < 0)
@@ -821,8 +823,16 @@
position +"px",
"important");
+ var percent = (parseInt((
+ position/(slider.clientWidth-knob.clientWidth))*100));
+
+ if (percent > 100)
+ {
+ percent = 100;
+ }
var return_data = new Object();
- return_data.val = (parseInt((position/slider.clientWidth) *100))+"%";
+ return_data.val = percent +"%";
+
return_data.direction = direction;
return return_data;
}
@@ -893,8 +903,10 @@
var pos = parseInt(slider.clientWidth *
time_and_state.percent);
- if (pos >= slider.clientWidth)
- pos = slider.clientWidth - knob.clientWidth;;
+ if (pos > (slider.clientWidth-knob.clientWidth))
+ {
+ pos = slider.clientWidth - knob.clientWidth;
+ }
knob.style.setProperty(move,
pos+"px",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [linterna-magica-commit] [294] Improved time and volume sliders behaviour.,
Ivaylo Valkov <=