adds name of page into title of tab in browser

This commit is contained in:
Paul Fitzpatrick
2022-04-15 12:33:34 -04:00
parent 05c89fb65a
commit dcb72a8e13
2 changed files with 12 additions and 2 deletions

View File

@@ -122,8 +122,12 @@ function pagePanelsDoc(owner: IDisposableOwner, appModel: AppModel, appObj: App)
gristDoc ? RightPanel.create(use.owner, gristDoc, rightPanelOpen) : null);
// Set document title to strings like "DocName - Grist"
owner.autoDispose(subscribe(pageModel.currentDocTitle, (use, docName) => {
document.title = `${docName} - Grist`;
owner.autoDispose(subscribe(pageModel.currentDocTitle, pageModel.currentDocPageName, (use, docName, pageName) => {
if (pageName) {
document.title = `${pageName} - ${docName} - Grist`;
} else {
document.title = `${docName} - Grist`;
}
}));
// Called after either panel is closed, opened, or resized.