mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
Add root pane.
This commit is contained in:
parent
566147cf63
commit
8c2412ca98
@ -4,4 +4,25 @@ mpdClient.controller('library', function ($scope, api) {
|
||||
$scope.$on('library:show', function () { $scope.show = true })
|
||||
|
||||
$scope.hide = function () { $scope.show = false }
|
||||
|
||||
var rootPane = {
|
||||
title: 'Library',
|
||||
entries: [
|
||||
{ label: 'Artists', path: '/artists' },
|
||||
{ label: 'Albums', path: '/albums' },
|
||||
{ label: 'Songs', path: '/songs' }
|
||||
]
|
||||
}
|
||||
|
||||
$scope.panes = [rootPane]
|
||||
|
||||
$scope.currentPaneIndex = 0
|
||||
|
||||
$scope.currentPane = function () {
|
||||
return $scope.panes[$scope.currentPaneIndex]
|
||||
}
|
||||
|
||||
$scope.newPane = function (path, params) {
|
||||
console.log(path)
|
||||
}
|
||||
})
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
mpdClient.controller('mpd-client', function ($rootScope, $scope) {
|
||||
$scope.showLibrary = function () { $scope.$broadcast('library:show') }
|
||||
|
||||
$scope.currentPanelTemplate = 'panels/root.html'
|
||||
})
|
||||
|
||||
@ -3,4 +3,5 @@
|
||||
<a class="close" href="#" ng-click="hide()">Close</a>
|
||||
<h1>Library</h1>
|
||||
</header>
|
||||
<ng-include src="currentPanelTemplate"></ng-include>
|
||||
</div>
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#library
|
||||
background: white
|
||||
position: absolute
|
||||
padding: 2.5rem 0 0
|
||||
top: 100%
|
||||
bottom: 0
|
||||
left: 0
|
||||
@ -30,10 +31,6 @@
|
||||
top: 0
|
||||
header
|
||||
top: 0
|
||||
.browser
|
||||
position: absolute
|
||||
height: 100%
|
||||
@include transition(left 0.25s ease-in-out)
|
||||
ul.root, ol.artists, ol.albums
|
||||
@extend .list
|
||||
ol.songs
|
||||
|
||||
5
public/panels/root.html
Normal file
5
public/panels/root.html
Normal file
@ -0,0 +1,5 @@
|
||||
<ul class="root">
|
||||
<li ng-repeat="entry in currentPane().entries">
|
||||
<a href="#" ng-click="newPane(entry.path, {})">{{ entry.label }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
Loading…
Reference in New Issue
Block a user