diff --git a/src/App.vue b/src/App.vue
index 741e5635..229ccaa5 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -419,6 +419,8 @@
}
},
doStuffAfterRoute(e) {
+ // this.setTitle('') // Reset the title if the page component does not set one itself
+
if (this.$store.state[IS_FULLPAGE]) {
this.$store.commit(IS_FULLPAGE, false)
}
diff --git a/src/helpers/setTitle.js b/src/helpers/setTitle.js
new file mode 100644
index 00000000..aec5a9fe
--- /dev/null
+++ b/src/helpers/setTitle.js
@@ -0,0 +1,9 @@
+
+export const setTitle = title => {
+ if (typeof title === 'undefined' || title === '') {
+ document.title = 'Vikunja'
+ return
+ }
+
+ document.title = `${title} | Vikunja`
+}
\ No newline at end of file
diff --git a/src/main.js b/src/main.js
index 6cd7f967..e6678562 100644
--- a/src/main.js
+++ b/src/main.js
@@ -143,6 +143,7 @@ Vue.directive('focus', {
import message from './message'
import {format, formatDistance} from 'date-fns'
import {colorIsDark} from './helpers/colorIsDark'
+import {setTitle} from './helpers/setTitle'
Vue.mixin({
methods: {
formatDateSince: date => {
@@ -161,7 +162,8 @@ Vue.mixin({
formatDate: date => format(date, 'PPPPpppp'),
error: (e, context, actions = []) => message.error(e, context, actions),
success: (s, context, actions = []) => message.success(s, context, actions),
- colorIsDark: colorIsDark
+ colorIsDark: colorIsDark,
+ setTitle: setTitle,
}
})
diff --git a/src/store/index.js b/src/store/index.js
index f20709ad..3e0e664f 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -11,6 +11,7 @@ import kanban from './modules/kanban'
import tasks from './modules/tasks'
import lists from './modules/lists'
import ListService from '../services/list'
+import {setTitle} from '../helpers/setTitle'
export const store = new Vuex.Store({
modules: {
@@ -45,6 +46,9 @@ export const store = new Vuex.Store({
state.isFullpage = fullpage
},
[CURRENT_LIST](state, currentList) {
+
+ setTitle(currentList.title)
+
// Not sure if this is the right way to do it but hey, it works
if (
// List changed
diff --git a/src/views/404.vue b/src/views/404.vue
index a2151d6a..6ae0dc31 100644
--- a/src/views/404.vue
+++ b/src/views/404.vue
@@ -7,6 +7,9 @@
diff --git a/src/views/labels/ListLabels.vue b/src/views/labels/ListLabels.vue
index c75b0ebf..6c78ebaa 100644
--- a/src/views/labels/ListLabels.vue
+++ b/src/views/labels/ListLabels.vue
@@ -117,6 +117,9 @@
this.labelEditLabel = new LabelModel()
this.loadLabels()
},
+ mounted() {
+ this.setTitle('Labels')
+ },
computed: mapState({
userInfo: state => state.auth.info
}),
diff --git a/src/views/list/EditList.vue b/src/views/list/EditList.vue
index 3cb12c8f..c41f4739 100644
--- a/src/views/list/EditList.vue
+++ b/src/views/list/EditList.vue
@@ -218,6 +218,7 @@
// This will trigger the dynamic loading of components once we actually have all the data to pass to them
this.manageTeamsComponent = 'manageSharing'
this.manageUsersComponent = 'manageSharing'
+ this.setTitle(`Edit ${this.list.title}`)
})
.catch(e => {
this.error(e, this)
diff --git a/src/views/list/NewList.vue b/src/views/list/NewList.vue
index 6935dacb..c7430bd1 100644
--- a/src/views/list/NewList.vue
+++ b/src/views/list/NewList.vue
@@ -51,6 +51,9 @@
this.listService = new ListService()
this.$store.commit(IS_FULLPAGE, true)
},
+ mounted() {
+ this.setTitle('Create a new list')
+ },
methods: {
newList() {
if (this.list.title === '') {
diff --git a/src/views/list/ShowList.vue b/src/views/list/ShowList.vue
index 565882d4..5dd600f5 100644
--- a/src/views/list/ShowList.vue
+++ b/src/views/list/ShowList.vue
@@ -70,11 +70,12 @@
return this.$store.state.background
},
currentList() {
- return typeof this.$store.state.currentList === 'undefined' ? {id: 0} : this.$store.state.currentList
+ return typeof this.$store.state.currentList === 'undefined' ? {id: 0, title: ''} : this.$store.state.currentList
},
},
methods: {
loadList() {
+ this.setTitle(this.currentList.title)
// This invalidates the loaded list at the kanban board which lets it reload its content when
// switched to it. This ensures updates done to tasks in the gantt or list views are consistently
diff --git a/src/views/migrator/Migrate.vue b/src/views/migrator/Migrate.vue
index bdf1f533..1868b8f8 100644
--- a/src/views/migrator/Migrate.vue
+++ b/src/views/migrator/Migrate.vue
@@ -14,6 +14,9 @@