Files
FE_Charts/mobile/www/js/routes.js
dario-cfpt abb1d2ec04 Updated config to fix clear text errors
A net::ERR_CLEARTEXT_NOT_PERMITTED occured when using the app on android
phone, we have to force the android to allow the communication to fix
the problem.
More info : https://stackoverflow.com/a/54752717/10736081

Also fixed a problem with the images path when running the app on
mobile.
2020-01-20 13:00:37 +01:00

49 lines
1.4 KiB
JavaScript

routes = [
{
path: '/',
templateUrl: './index.html',
on: {
pageAfterIn: () => {
displayCharacters();
}
}
},
{
path: '/classes/',
templateUrl: './pages/classes.html',
},
{
name: 'stat',
path: '/stat/:charId',
templateUrl: './pages/stat.html',
on: {
pageInit: (e, page) => {
const charId = page.route.params.charId;
if (charId != null) {
const char = feData.characters.find(x => x.id == charId);
let charFullName = (char.lastName) ? char.firstName + " " + char.lastName
: char.firstName;
$$("#title-char").text(charFullName);
$$("#picture-char").attr("src", "img/characters/" + char.firstName + ".png");
actualCharId = charId;
createTableOfStats();
displayTableOfGrowthRates();
$$("#select-graph").on("change", () => {
displayGraphOfGrowthRates();
});
}
}
}
},
{
path: '/comparator/',
templateUrl: './pages/comparator.html'
},
{
path: '/about/',
templateUrl: './pages/about.html'
},
];