fix setting the title bar when switching note

This commit is contained in:
zadam 2019-05-29 19:55:05 +02:00
parent 373ec4ac50
commit 8d3262d232
2 changed files with 16 additions and 1 deletions

View File

@ -553,7 +553,13 @@ class NoteDetailRelationMap {
getZoom() { getZoom() {
const matrixRegex = /matrix\((-?\d*\.?\d+),\s*0,\s*0,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+\)/; const matrixRegex = /matrix\((-?\d*\.?\d+),\s*0,\s*0,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+,\s*-?\d*\.?\d+\)/;
const matches = this.$relationMapContainer.css('transform').match(matrixRegex); const transform = this.$relationMapContainer.css('transform');
const matches = transform.match(matrixRegex);
if (!matches) {
throw new Error("Cannot match transform: " + transform);
}
return matches[1]; return matches[1];
} }

View File

@ -101,6 +101,8 @@ class TabContext {
this.setCurrentNotePathToHash(); this.setCurrentNotePathToHash();
this.setTitleBar();
setTimeout(async () => { setTimeout(async () => {
// we include the note into recent list only if the user stayed on the note at least 5 seconds // we include the note into recent list only if the user stayed on the note at least 5 seconds
if (notePath && notePath === this.notePath) { if (notePath && notePath === this.notePath) {
@ -123,6 +125,13 @@ class TabContext {
show() { show() {
this.$tabContent.show(); this.$tabContent.show();
this.setCurrentNotePathToHash(); this.setCurrentNotePathToHash();
this.setTitleBar();
}
setTitleBar() {
if (!this.$tabContent.is(":visible")) {
return;
}
document.title = "Trilium Notes"; document.title = "Trilium Notes";