From f968f0e4bcc6e195eb293c4e2b965e8879075d8b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 16 Dec 2018 22:35:49 +0100 Subject: ok --- client/index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client/index.js') 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') -- cgit v1.2.3-70-g09d2