Skip to content

Commit

Permalink
Add document/page title for sketches
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmvd committed Oct 17, 2024
1 parent 4d6e1e6 commit d50a0ad
Show file tree
Hide file tree
Showing 2 changed files with 12,486 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
Loading

0 comments on commit d50a0ad

Please sign in to comment.