diff options
author | pacien | 2018-10-24 04:39:48 +0200 |
---|---|---|
committer | pacien | 2018-10-24 04:55:15 +0200 |
commit | ed02ccffb07a41e86a52a870e8f0abdc5d5078d0 (patch) | |
tree | 250372eb2ef10024391ea62fcca67de36b3223dc /pointless | |
parent | 28471e245eed59ebe0d57d7a4f162796eda0943d (diff) | |
download | beamer-viewer-ed02ccffb07a41e86a52a870e8f0abdc5d5078d0.tar.gz |
Use URL anchor to avoid query cache miss
Diffstat (limited to 'pointless')
-rw-r--r-- | pointless/viewer/init.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pointless/viewer/init.js b/pointless/viewer/init.js index 01f550c..e76ab1b 100644 --- a/pointless/viewer/init.js +++ b/pointless/viewer/init.js | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | const params = function() { | 21 | const params = function() { |
22 | const queryDict = {}; | 22 | const queryDict = {}; |
23 | location.search.substr(1).split("&").forEach(function(item) { | 23 | location.hash.substr(1).split("&").forEach(item => { |
24 | const pair = item.split("="); | 24 | const pair = item.split("="); |
25 | queryDict[pair[0]] = pair[1]; | 25 | queryDict[pair[0]] = pair[1]; |
26 | }); | 26 | }); |
@@ -58,5 +58,10 @@ function init() { | |||
58 | viewer.load(params["file"]); | 58 | viewer.load(params["file"]); |
59 | } | 59 | } |
60 | 60 | ||
61 | function load(file) { | ||
62 | location.hash = "file=" + file; | ||
63 | location.reload(); | ||
64 | } | ||
65 | |||
61 | if (isController()) | 66 | if (isController()) |
62 | init(); | 67 | init(); |