Skip to content

Commit

Permalink
fix #36 make about dialog shareable with an url
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Nov 26, 2018
1 parent 22e87f1 commit 114d326
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/components/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
v-model="dialog"
scrollable
width="70%"
:key="status()"
>

<v-list-tile slot="activator" color="primary" class="v-list__tile--link">
<v-list-tile slot="activator" color="primary" class="v-list__tile--link" @click="open()">
<v-list-tile-action>
<v-icon>{{$vuetify.icons.about}}</v-icon>
</v-list-tile-action>
Expand Down Expand Up @@ -104,7 +105,7 @@
<v-btn
color="primary"
flat
@click="dialog = false"
@click="close()"
>
Close
</v-btn>
Expand All @@ -119,6 +120,7 @@ import DataStore from '@/services/DataStore';
import Config from '../../types/Config';
import { IPackageJSON } from '../../types/package-json';
import ExternalLink from './ExternalLink.vue';
import Router from '../router';
@Component({
name: 'About',
Expand All @@ -141,7 +143,7 @@ export default class About extends Vue {
constructor() {
super();
this.dialog = false;
this.dialog = Router.currentRoute.hash === '#about';
this.data = {
meta: undefined,
config: {
Expand Down Expand Up @@ -171,6 +173,22 @@ export default class About extends Vue {
}
});
}
private open(): void {
Router.push('#about');
this.dialog = true;
}
private close(): void {
this.dialog = false;
}
private status(): boolean {
if (!this.dialog) {
Router.push(Router.currentRoute.path);
}
return this.dialog;
}
}
</script>

Expand Down

0 comments on commit 114d326

Please sign in to comment.