1
0
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:
Dan Barber 2014-03-20 15:09:18 +00:00
parent 7e4aa10b4d
commit 9f337dd1d1
2 changed files with 9 additions and 1 deletions

View File

@ -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)
})

View File

@ -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">