Browse Source

Fix unexpected 'undefined' path

Added missing checks of (optional and uninitialized) basePath attribute of config.multiRes. So default basePath/ tourConfig's basePath and multires basePath are the same if there is no explicit setting.
pull/67/head
mko 9 years ago
parent
commit
39590a6b00
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/js/pannellum.js

+ 6
- 2
src/js/pannellum.js View File

@@ -193,10 +193,14 @@ function init() {
infoDisplay.load.lbar.style.display = 'none'; infoDisplay.load.lbar.style.display = 'none';
} else if (config.type == 'multires') { } else if (config.type == 'multires') {
var c = JSON.parse(JSON.stringify(config.multiRes)); // Deep copy var c = JSON.parse(JSON.stringify(config.multiRes)); // Deep copy
if (config.basePath) {
if (config.basePath && config.multiRes.basePath) { // avoid 'undefined' in path, check (optional) multiRes.basePath, too
c.basePath = config.basePath + config.multiRes.basePath; c.basePath = config.basePath + config.multiRes.basePath;
} else if (tourConfig.basePath) {
} else if (config.basePath) {
c.basePath = config.basePath;
} else if (tourConfig.basePath && config.multiRes.basePath) { // avoid 'undefined' in path, check (optional) multiRes.basePath, too
c.basePath = tourConfig.basePath + config.multiRes.basePath; c.basePath = tourConfig.basePath + config.multiRes.basePath;
} else if (tourConfig.basePath) {
c.basePath = tourConfig.basePath;
} }
panoImage = c; panoImage = c;
} else { } else {


Loading…
Cancel
Save