diff options
Diffstat (limited to 'client/index.js')
| -rw-r--r-- | client/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/index.js b/client/index.js index 90fc22e1..2beb5526 100644 --- a/client/index.js +++ b/client/index.js @@ -69,7 +69,8 @@ function runApplets() { dataset = null url = opt } else if (opt.indexOf('assets') === 0) { - url = 'https://nyc3.digitaloceanspaces.com/megapixels/v1' + window.location.pathname + opt + let pathname = window.location.pathname.replace('index.html', '') + url = 'https://nyc3.digitaloceanspaces.com/megapixels/v1' + pathname + opt dataset = null // console.log(url) } else { @@ -80,7 +81,10 @@ function runApplets() { if (!dataset && !url) { const path = window.location.pathname.split('/').filter(s => !!s) if (path.length) { - dataset = path[path.length - 1] + dataset = path.pop() + if (dataset === 'index.html') { + dataset = path.pop() + } // console.log('dataset from path:', dataset) } else { console.log('couldnt determine citations dataset') |
