Skip to content

Commit 9fbfe68

Browse files
committed
feat(app): set missing titles
1 parent ed54db6 commit 9fbfe68

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/components/main/dashboard/dashboard.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ function controller($mdToast, $state, $window, WikiService, langService) {
99
vm.loading = false;
1010
vm.saveLanguages = saveLanguages;
1111

12+
init();
13+
14+
function init() {
15+
$window.document.title = 'Dashboard – Monumental';
16+
}
17+
1218
function saveLanguages() {
1319
langService.setUserLanguages(vm.languages.filter(lang => lang))
1420
.then(() => {

src/components/main/games/category/games-category.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ function controller($q, $state, $stateParams, $window, WikiService, langService,
6666
vm.loading = true;
6767
vm.list = [];
6868

69+
$window.document.title = 'Monumental';
70+
6971
getCountry();
7072
getList()
7173
.then((response) => {

src/components/main/list/list.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import template from './list.html';
33

44
const ListComponent = { controller, template };
55

6-
function controller($state, $stateParams, $timeout, langService, leafletData, localStorageService, mapService, WikiService, wikidata) {
6+
function controller($state, $stateParams, $timeout, $window, langService, leafletData, localStorageService, mapService, WikiService, wikidata) {
77
const vm = this;
88
const icon = mapService.getMapIcon();
99
const id = $stateParams.id.includes('Q') ? $stateParams.id : `Q${$stateParams.id}`;
@@ -60,7 +60,12 @@ function controller($state, $stateParams, $timeout, langService, leafletData, lo
6060

6161
function init() {
6262
getPlace()
63-
.then(() => getList())
63+
.then(() => {
64+
const title = vm.place.labels[vm.lang] || vm.place.labels.en || vm.place.id;
65+
$window.document.title = `${title} – Monumental`;
66+
67+
return getList();
68+
})
6469
.then((data) => {
6570
// console.log(data)
6671
vm.list = data.map(element => ({

src/components/main/map/map.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import template from './map.html';
33

44
const MapComponent = { controller, template };
55

6-
function controller($location, $scope, $state, $stateParams, $timeout, langService, leafletData, localStorageService, mapService, wikidata) {
6+
function controller($location, $scope, $state, $stateParams, $timeout, $window, langService, leafletData, localStorageService, mapService, wikidata) {
77
const vm = this;
88
const icon = mapService.getMapIcon();
99
const langs = langService.getUserLanguages();
@@ -36,6 +36,8 @@ function controller($location, $scope, $state, $stateParams, $timeout, langServi
3636
});
3737
}, 100);
3838

39+
$window.document.title = 'Monumental';
40+
3941
// functions
4042

4143
function getDataBB(bounds) {

0 commit comments

Comments
 (0)