Fix web icons ignoring web_root (#291)

Fix the URLs for the item icons in the web interface ignoring the
web_root config option.

[travis skip]
This commit is contained in:
Hornwitser authored and GitHub committed 2020-04-17 17:46:17 +02:00
1 parent ef6441ca46
commit 15ad64e356
1 file changed
+2 -2
+2 -2
View File
@@ -187,7 +187,7 @@ function replaceAll(target, search, replacement) {
function getImageFromName(name){
if(imagelinks[name]){
return imagelinks[name];
return root + imagelinks[name].slice(1);
} else if(imagedata[name]) {
return "https://wiki.factorio.com/images/" + imagedata[name] + ".png";
} else if(factorioLocale["entity-name"] && factorioLocale["entity-name"][name]){
@@ -201,7 +201,7 @@ function getImageFromName(name){
} else return `${root}pictures/unknown-item.png`;
}
window.factorioLocale = {};
$.getJSON("/api/getFactorioLocale", (locale) => {
$.getJSON(`${root}api/getFactorioLocale`, (locale) => {
window.factorioLocale = locale;
});
// image data