mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-14 18:09:59 +00:00
Only modify document title if running standalone (#3071)
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
|
||||
const PREFIX = document.title || 'Weave Scope';
|
||||
const SEPARATOR = ' - ';
|
||||
const STANDALONE_TITLE = 'Weave Scope';
|
||||
const STANDALONE = document.title === STANDALONE_TITLE;
|
||||
const SEPARATOR = ' – ';
|
||||
|
||||
export function setDocumentTitle(title) {
|
||||
if (!STANDALONE) {
|
||||
return;
|
||||
}
|
||||
if (title) {
|
||||
document.title = [PREFIX, title].join(SEPARATOR);
|
||||
document.title = [STANDALONE_TITLE, title].join(SEPARATOR);
|
||||
} else {
|
||||
document.title = PREFIX;
|
||||
document.title = STANDALONE_TITLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user