diff --git a/src/components/app/app.ts b/src/components/app/app.ts index 3c2c458..20f071f 100644 --- a/src/components/app/app.ts +++ b/src/components/app/app.ts @@ -251,26 +251,6 @@ export default class App extends Vue this.loading = message; } - /** - * This is called when a navigation tab is clicked - * - * @param tab Tab name - */ - public onNavigate(tab: string) - { - // Debug output TODO: Remove this - console.log(`onNavigate: Previous: ${this.selectedTab}, New: ${tab}`); - - // Update selected tab - this.selectedTab = tab; - - // Check url - let url = `/${tab}`; - - // Push history state - window.history.pushState({lastTab: this.selectedTab}, '', url); - } - /** * Sign out */ diff --git a/src/components/navigation/navigation.ts b/src/components/navigation/navigation.ts index 95098b2..95c9400 100644 --- a/src/components/navigation/navigation.ts +++ b/src/components/navigation/navigation.ts @@ -50,6 +50,18 @@ export default class Navigation extends Vue // Call custom event this.$emit('navigation:select', this.activeIndex); + + // Debug output TODO: Remove this + console.log(`onNavigate: Previous: ${this.activeIndex}, New: ${index}`); + + // Update selected tab + this.activeIndex = index; + + // Check url + let url = `/${index}`; + + // Push history state + window.history.pushState({lastTab: index}, '', url); } /**