diff options
author | pacien | 2023-10-26 21:21:23 +0200 |
---|---|---|
committer | pacien | 2023-10-26 21:21:31 +0200 |
commit | f535d1008e143eb01d2a622a1f5a123acafbfb13 (patch) | |
tree | bdae72c9643e1f25925c96f90035b4b66d62c471 /beamer/viewer | |
parent | 007c11f04a256a2e8704a9b26320e5c0e3457994 (diff) | |
download | beamer-viewer-f535d1008e143eb01d2a622a1f5a123acafbfb13.tar.gz |
viewer: cleaner hash query dict
Diffstat (limited to 'beamer/viewer')
-rw-r--r-- | beamer/viewer/viewer.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/beamer/viewer/viewer.js b/beamer/viewer/viewer.js index a10e6de..fa8d04e 100644 --- a/beamer/viewer/viewer.js +++ b/beamer/viewer/viewer.js | |||
@@ -103,11 +103,11 @@ class Viewer { | |||
103 | } | 103 | } |
104 | 104 | ||
105 | _hash_params() { | 105 | _hash_params() { |
106 | const queryDict = {}; | 106 | return Object.fromEntries( |
107 | location.hash.slice(1).split("&").forEach(item => { | 107 | location.hash |
108 | const pair = item.split("="); | 108 | .slice(1) // skip # |
109 | queryDict[pair[0]] = pair[1]; | 109 | .split("&") |
110 | }); | 110 | .map(item => item.split("=")) |
111 | return queryDict; | 111 | ); |
112 | } | 112 | } |
113 | } | 113 | } |