mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
Add marker position and conditional.
This commit is contained in:
parent
7e4aa10b4d
commit
9f337dd1d1
@ -21,10 +21,18 @@ mpdClient.controller('transport', function ($scope, $http, serverEvents) {
|
||||
$http({ method: 'PUT', url: '/api/control/' + command })
|
||||
}
|
||||
|
||||
$scope.stopped = function () {
|
||||
return $scope.status.state == 'stop'
|
||||
}
|
||||
|
||||
$scope.playing = function () {
|
||||
return $scope.status.state == 'play'
|
||||
}
|
||||
|
||||
$scope.markerPosition = function () {
|
||||
return ($scope.elapsedTime / $scope.totalTime) * 100
|
||||
}
|
||||
|
||||
serverEvents.onUpdateStatus($scope.updateStatus)
|
||||
serverEvents.onUpdateTime($scope.updateTime)
|
||||
})
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<div class="time elapsed">{{ elapsedTime | formatLength }}</div>
|
||||
<div class="time total">{{ totalTime | formatLength }}</div>
|
||||
<div class="track">
|
||||
<div class="marker" style="left: {{ markerPosition }}%"></div>
|
||||
<div class="marker" style="left: {{ markerPosition() }}%" ng-if="!stopped()"></div>
|
||||
</div>
|
||||
</div>
|
||||
<nav class="controls">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user