Skip to content

Commit acf6284

Browse files
authored
Merge pull request #447 from TeskaLabs/fix/dynamic-page-title
Fix dynamic page title
2 parents 3eddd42 + f8138da commit acf6284

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# CHANGELOG
22

3-
## Release Candidate
3+
## v24.39
4+
5+
### Releases
6+
7+
- v24.39-alpha
48

59
### Breaking change
610

@@ -102,6 +106,8 @@
102106

103107
### Bugfix
104108

109+
- Fix dynamic page title (#447, PLUM Sprint 240906, v24.39-alpha)
110+
105111
- Change key for locales to be reusable (INDIGO Sprint 230721, [!442](https://github.com/TeskaLabs/asab-webui/pull/442))
106112

107113
- Bug fix for HelpComponent, not display a Helpcomoponent when the user changing the page (INDIGO Sprint 230317, [!401](https://github.com/TeskaLabs/asab-webui/pull/401))

src/services/TitleService.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import Service from '../abc/Service';
22
export default class TitleService extends Service {
3-
constructor(app, serviceName="TitleService"){
3+
constructor(app, serviceName = 'TitleService') {
44
super(app, serviceName);
55
this.App = app;
6-
this.title = "";
6+
this.title = '';
77
}
88

99
initialize() {
10-
this.title = this.App.Config.get("title");
10+
this.title = this.App.Config.get('title');
11+
if (this.title) {
12+
document.title = this.title;
13+
}
1114
}
1215

1316
setTitle = (subTitle) => {
14-
document.title = (this.title && subTitle) ? `${this.title} | ${subTitle}` : this.title;
15-
}
17+
document.title = (this.title && subTitle)
18+
? `${this.title} | ${subTitle}`
19+
: this.title;
20+
};
1621
}
17-

0 commit comments

Comments
 (0)