Skip to content

Commit

Permalink
Update page title when switching between Pending and Completed vi…
Browse files Browse the repository at this point in the history
…ews (#1084)

* Update page title when switching between `Pending` and `Completed` views

* Update index.vue

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
JayBizzle and taylorotwell authored Oct 7, 2021
1 parent b348f14 commit 43502f7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions resources/js/screens/recentJobs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
* Prepare the component.
*/
mounted() {
document.title = this.$route.params.type == 'pending'
? 'Horizon - Pending Jobs'
: 'Horizon - Completed Jobs';
this.updatePageTitle();
this.loadJobs();
Expand All @@ -50,6 +48,8 @@
*/
watch: {
'$route'() {
this.updatePageTitle();
this.page = 1;
this.loadJobs();
Expand Down Expand Up @@ -129,6 +129,15 @@
this.page += 1;
this.hasNewEntries = false;
},
/**
* Update the page title.
*/
updatePageTitle() {
document.title = this.$route.params.type == 'pending'
? 'Horizon - Pending Jobs'
: 'Horizon - Completed Jobs';
}
}
}
Expand Down

0 comments on commit 43502f7

Please sign in to comment.