mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
WIP: Add marker and move away from rootscope.
This commit is contained in:
parent
0ae60095a4
commit
7e4aa10b4d
@ -1,10 +1,10 @@
|
||||
mpdClient.controller('queue', function ($rootScope, $scope, $resource, serverEvents) {
|
||||
mpdClient.controller('queue', function ($scope, $resource, serverEvents) {
|
||||
var Queue = $resource('/api/queue')
|
||||
|
||||
$rootScope.queueSongs = Queue.query()
|
||||
$scope.queueSongs = Queue.query()
|
||||
|
||||
$scope.updateQueue = function(data) {
|
||||
$rootScope.queueSongs = data
|
||||
$scope.queueSongs = data
|
||||
}
|
||||
|
||||
serverEvents.onUpdateQueue($scope.updateQueue)
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
mpdClient.controller('transport', function ($rootScope, $scope, $http, serverEvents) {
|
||||
mpdClient.controller('transport', function ($scope, $http, serverEvents) {
|
||||
var Status = $http({ method: 'GET', url: '/api/status' })
|
||||
|
||||
$rootScope.status = {}
|
||||
$scope.status = {}
|
||||
|
||||
Status.success(function (data, status, headers, config) {
|
||||
$scope.updateStatus(data)
|
||||
})
|
||||
|
||||
$scope.updateStatus = function(data) {
|
||||
$rootScope.status = data
|
||||
$scope.status = data
|
||||
if (data.time) { $scope.updateTime(data.time) }
|
||||
}
|
||||
|
||||
$scope.updateTime = function(data) {
|
||||
$rootScope.elapsedTime = data[0]
|
||||
$rootScope.totalTime = data[1]
|
||||
$scope.elapsedTime = data[0]
|
||||
$scope.totalTime = data[1]
|
||||
}
|
||||
|
||||
$scope.sendCommand = function (command) {
|
||||
|
||||
@ -28,6 +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>
|
||||
</div>
|
||||
<nav class="controls">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user