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.$on('library:show', function () { $scope.show = true })
|
||||||
|
|
||||||
$scope.hide = function () { $scope.show = false }
|
$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) {
|
mpdClient.controller('mpd-client', function ($rootScope, $scope) {
|
||||||
$scope.showLibrary = function () { $scope.$broadcast('library:show') }
|
$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>
|
<a class="close" href="#" ng-click="hide()">Close</a>
|
||||||
<h1>Library</h1>
|
<h1>Library</h1>
|
||||||
</header>
|
</header>
|
||||||
|
<ng-include src="currentPanelTemplate"></ng-include>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#library
|
#library
|
||||||
background: white
|
background: white
|
||||||
position: absolute
|
position: absolute
|
||||||
|
padding: 2.5rem 0 0
|
||||||
top: 100%
|
top: 100%
|
||||||
bottom: 0
|
bottom: 0
|
||||||
left: 0
|
left: 0
|
||||||
@ -30,17 +31,13 @@
|
|||||||
top: 0
|
top: 0
|
||||||
header
|
header
|
||||||
top: 0
|
top: 0
|
||||||
.browser
|
ul.root, ol.artists, ol.albums
|
||||||
|
@extend .list
|
||||||
|
ol.songs
|
||||||
|
@extend .song-list
|
||||||
|
div
|
||||||
position: absolute
|
position: absolute
|
||||||
|
width: $interface-width
|
||||||
height: 100%
|
height: 100%
|
||||||
@include transition(left 0.25s ease-in-out)
|
padding: 2.5em 0 0
|
||||||
ul.root, ol.artists, ol.albums
|
overflow: auto
|
||||||
@extend .list
|
|
||||||
ol.songs
|
|
||||||
@extend .song-list
|
|
||||||
div
|
|
||||||
position: absolute
|
|
||||||
width: $interface-width
|
|
||||||
height: 100%
|
|
||||||
padding: 2.5em 0 0
|
|
||||||
overflow: auto
|
|
||||||
|
|||||||
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