Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Commit 585db27

Browse files
Matt Gauntaddyosmani
authored andcommitted
Removing old comment and adding default title (Closes #52)
1 parent 899d294 commit 585db27

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/scripts/controller/PageController.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ export default class PageController {
22
constructor() {
33
this.loader = document.querySelector('.js-global-loader');
44
this.mainContainer = document.querySelector('.js-global-main');
5+
6+
this.DEFAULT_TITLE = 'App Shell';
57
}
68

79
onUpdate() {
@@ -33,13 +35,11 @@ export default class PageController {
3335
throw new Error('Unexpected response from Server.');
3436
}
3537

36-
/**
37-
* NOTE: We could move the script tags in the partial to the
38-
* bottom of the body, but I don't think it'll change browser
39-
* behaviour so it should be fine to inline the script tag in
40-
* the main element.
41-
**/
42-
document.title = responseObject.title;
38+
if (responseObject.title) {
39+
document.title = responseObject.title;
40+
} else {
41+
document.title = this.DEFAULT_TITLE;
42+
}
4343

4444
// Add style element to the document head
4545
var styleElement = document.createElement('style');

0 commit comments

Comments
 (0)