Document title now set with each route
This commit is contained in:
@@ -26,6 +26,9 @@ Router.map( function () {
|
|||||||
characters: function(){
|
characters: function(){
|
||||||
return Characters.find({}, {fields: {_id: 1}});
|
return Characters.find({}, {fields: {_id: 1}});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
onAfterAction: function() {
|
||||||
|
document.title = appName;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -39,25 +42,15 @@ Router.map( function () {
|
|||||||
data: function() {
|
data: function() {
|
||||||
var data = Characters.findOne({_id: this.params._id}, {fields: {_id: 1, name: 1, color: 1}});
|
var data = Characters.findOne({_id: this.params._id}, {fields: {_id: 1, name: 1, color: 1}});
|
||||||
return data;
|
return data;
|
||||||
}
|
},
|
||||||
});
|
onAfterAction: function() {
|
||||||
|
var char = Characters.findOne({_id: this.params._id}, {fields: {_id: 1, name: 1, color: 1}});
|
||||||
this.route('inventory', {
|
var name = char.name;
|
||||||
path: '/inventory/:_id',
|
if(name){
|
||||||
data: {
|
document.title = name;
|
||||||
containers: function() {
|
} else {
|
||||||
var containers = Containers.find({owner: data._id}, {fields: {_id: 1}});
|
document.title = appName + "Character";
|
||||||
return containers;
|
}
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.route('item', {
|
|
||||||
path: '/item/:_id',
|
|
||||||
data: function() {
|
|
||||||
var data = Items.findOne({_id: this.params._id});
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -66,6 +59,9 @@ Router.map( function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.route('profile', {
|
this.route('profile', {
|
||||||
path: '/account'
|
path: '/account',
|
||||||
|
onAfterAction: function() {
|
||||||
|
document.title = appName + " Account";
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>RPG Docs</title>
|
|
||||||
<meta name="viewport" content="width=device-width initial-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width initial-scale=1.0, user-scalable=no">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic,900,900italic,100italic,100&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
|
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,300italic,400italic,500,500italic,700,700italic,900,900italic,100italic,100&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
|
||||||
|
|||||||
1
rpg-docs/lib/constants/appName.js
Normal file
1
rpg-docs/lib/constants/appName.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
appName = "Dice Cloud";
|
||||||
Reference in New Issue
Block a user