Skip to content

Commit

Permalink
Add document/page title for sketches (#3210)
Browse files Browse the repository at this point in the history
* Add document/page title for sketches

---------

Co-authored-by: Janosch <[email protected]>
  • Loading branch information
itsmvd and jkppr authored Oct 18, 2024
1 parent e4a5bc0 commit c0c8d9a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions timesketch/frontend-ng/src/views/Sketch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ export default {
if (this.hasTimelines && !this.isArchived) {
this.showLeftPanel = true
}
this.updateDocumentTitle();
this.loadingSketch = false
})
EventBus.$on('showContextWindow', this.showContextWindow)
Expand Down Expand Up @@ -585,8 +586,20 @@ export default {
}, 100)
}
},
updateDocumentTitle: function() {
if (this.sketch && this.sketch.name && this.sketch.id) {
document.title = `[${this.sketch.id}] ${this.sketch.name}`;
} else {
document.title = 'Timesketch';
}
},
},
watch: {
sketch(newSketch) {
if (newSketch) {
this.updateDocumentTitle();
}
},
hasTimelines(newVal, oldVal) {
if (oldVal === 0 && newVal > 0) {
this.showLeftPanel = true
Expand Down

0 comments on commit c0c8d9a

Please sign in to comment.