1
0
mirror of https://github.com/danbee/mpd-client synced 2025-03-04 08:39:09 +00:00

Add back button. Just needs plumbing in.

This commit is contained in:
Dan Barber 2013-12-17 11:42:30 +00:00
parent 9b99eb80ed
commit ff3bb3bdec
3 changed files with 20 additions and 1 deletions

View File

@ -16,6 +16,15 @@
right: 10px right: 10px
top: 8px top: 8px
@include button @include button
a.back
position: absolute
left: 10px
top: 8px
&:before
margin-right: 0.25em
@extend .icon
@extend .icon-chevron-left
@include button
&.show &.show
top: 0 top: 0
header header

View File

@ -44,6 +44,10 @@ var Library = can.Control.extend({
this.nextPane(); this.nextPane();
}, },
removePane: function(data) {
this.previousPane();
},
'a.close click': 'hide', 'a.close click': 'hide',
'route': function(data) { 'route': function(data) {
@ -53,9 +57,12 @@ var Library = can.Control.extend({
':page route': function(data) { ':page route': function(data) {
if (data.page == 'library') { if (data.page == 'library') {
this.show(); this.show();
if (data.show) { if (data.pane > this.browser.currentPane) {
this.addPane(data); this.addPane(data);
} }
else if (data.pane < this.browser.currentPane) {
this.removePane(data);
}
} }
} }

View File

@ -1,4 +1,7 @@
<header> <header>
<% if (browser.attr('currentPane') > 0) { %>
<%== can.route.link('Back', { page: 'library', pane: browser.attr('currentPane') - 1 }, { class: 'back' }) %>
<% } %>
<a class="close" href="#!">Close</a> <a class="close" href="#!">Close</a>
<h1><%= browser.attr('title') %></h1> <h1><%= browser.attr('title') %></h1>
</header> </header>