pinafore/routes/_components/Layout.html

35 lines
859 B
HTML
Raw Normal View History

2018-02-03 19:57:45 +01:00
<Nav :page />
2018-01-07 00:51:25 +01:00
<div class="container" tabindex="0" ref:container>
<main>
<slot></slot>
</main>
2018-03-07 18:25:07 +01:00
{{#if !$isUserLoggedIn && page === 'home'}}
<InformationalFooter />
2018-03-07 18:25:07 +01:00
{{/if}}
</div>
2018-01-07 00:51:25 +01:00
<script>
import Nav from './Nav.html';
2018-01-28 22:09:39 +01:00
import { store } from '../_store/store'
import InformationalFooter from './InformationalFooter.html'
2018-01-07 00:51:25 +01:00
// Only focus the `.container` div on first load so it does not intefere
// with other desired behaviours (e.g. you click a toot, you navigate from
// a timeline view to a thread view, you press the back button, and now
// you're still focused on the toot).
let firstTime = true
2018-01-07 00:51:25 +01:00
export default {
components: {
2018-03-07 18:25:07 +01:00
Nav,
InformationalFooter
},
oncreate () {
if (firstTime) {
firstTime = false
this.refs.container.focus()
}
},
store: () => store
2018-01-23 06:30:14 +01:00
}
2018-01-07 00:51:25 +01:00
</script>