mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Abstract position update
This commit is contained in:
parent
9453f7fae2
commit
aa7f2ec362
2 changed files with 7 additions and 3 deletions
|
|
@ -213,9 +213,9 @@ MainWindow = {
|
|||
this.nodes.window.classList.add('closed');
|
||||
},
|
||||
|
||||
updatePosition: function(percent) {
|
||||
updatePosition: function() {
|
||||
if(!this.nodes.window.classList.contains('setting-position')) {
|
||||
this.nodes.position.value = percent;
|
||||
this.nodes.position.value = this.winamp.getPercentComplete();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -234,6 +234,7 @@ MainWindow = {
|
|||
|
||||
updateTime: function() {
|
||||
this.updateShadePositionClass();
|
||||
this.updatePosition();
|
||||
|
||||
var shadeMinusCharacter = ' ';
|
||||
if(this.nodes.time.classList.contains('countdown')) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ Winamp = {
|
|||
this.windowManager.registerWindow(this.mainWindow);
|
||||
|
||||
this.media.addEventListener('timeupdate', function() {
|
||||
self.mainWindow.updatePosition(self.media.percentComplete());
|
||||
window.dispatchEvent(self.events.timeUpdated);
|
||||
});
|
||||
|
||||
|
|
@ -90,6 +89,10 @@ Winamp = {
|
|||
return this.media.timeElapsed();
|
||||
},
|
||||
|
||||
getPercentComplete: function() {
|
||||
return this.media.percentComplete()
|
||||
},
|
||||
|
||||
getChannelCount: function() {
|
||||
return this.media.channels();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue