blob: e1bb410365f12074ef7cb1bd4c9b3631a37b32dd [file] [log] [blame]
Derick Montaguee080a1a2019-12-04 16:30:08 -06001<template>
2 <div>
Derick Montague09e45cd2020-01-23 15:45:57 -06003 <app-header ref="focusTarget" />
Derick Montaguee080a1a2019-12-04 16:30:08 -06004 <b-container fluid class="page-container">
5 <b-row no-gutters>
6 <b-col tag="nav" cols="12" md="3" lg="2">
Derick Montague09e45cd2020-01-23 15:45:57 -06007 <app-navigation />
Derick Montaguee080a1a2019-12-04 16:30:08 -06008 </b-col>
9 <b-col cols="12" md="9" lg="10">
Derick Montague09e45cd2020-01-23 15:45:57 -060010 <page-container>
Derick Montague75b48322019-12-06 01:24:41 -060011 <router-view ref="routerView" />
Derick Montague09e45cd2020-01-23 15:45:57 -060012 </page-container>
Derick Montaguee080a1a2019-12-04 16:30:08 -060013 </b-col>
14 </b-row>
15 </b-container>
16 </div>
17</template>
18
19<script>
Derick Montaguee2fd1562019-12-20 13:26:53 -060020import AppHeader from '@/components/AppHeader';
21import AppNavigation from '@/components/AppNavigation';
22import PageContainer from '../components/Global/PageContainer';
Derick Montaguee080a1a2019-12-04 16:30:08 -060023export default {
Derick Montaguee2fd1562019-12-20 13:26:53 -060024 name: 'App',
Derick Montaguee080a1a2019-12-04 16:30:08 -060025 components: {
26 AppHeader,
Yoshie Muranaka8d129102019-12-19 09:51:55 -080027 AppNavigation,
28 PageContainer
Derick Montague75b48322019-12-06 01:24:41 -060029 },
30 watch: {
31 $route: function() {
32 // $nextTick = DOM updated
33 this.$nextTick(function() {
34 // Get the focusTarget DOM element
35 let focusTarget = this.$refs.focusTarget.$el;
36
37 // Make focustarget programmatically focussable
Derick Montaguee2fd1562019-12-20 13:26:53 -060038 focusTarget.setAttribute('tabindex', '-1');
Derick Montague75b48322019-12-06 01:24:41 -060039
40 // Focus element
41 focusTarget.focus();
42
43 // Remove tabindex from focustarget
44 // Reason: https://axesslab.com/skip-links/#update-3-a-comment-from-gov-uk
Derick Montaguee2fd1562019-12-20 13:26:53 -060045 focusTarget.removeAttribute('tabindex');
Derick Montague75b48322019-12-06 01:24:41 -060046 });
47 }
Derick Montaguee080a1a2019-12-04 16:30:08 -060048 }
49};
50</script>
51
52<style lang="scss" scoped>
53.page-container {
54 margin-right: 0;
55 margin-left: 0;
56 padding-right: 0;
57 padding-left: 0;
58}
59</style>