diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-12-16 22:35:49 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-12-16 22:35:49 +0100 |
| commit | f968f0e4bcc6e195eb293c4e2b965e8879075d8b (patch) | |
| tree | d8c0c09787df4bcabc81e438c420075119f007a4 /client/index.js | |
| parent | f9e4b621c9daf66a599c28481b3bf59926144461 (diff) | |
ok
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') |
