a lot of refactoring of topic-info

This commit is contained in:
or-else
2021-08-06 14:58:05 -07:00
parent 642821db9f
commit 6d4ff9d625
23 changed files with 832 additions and 386 deletions
+6 -2
View File
@@ -9,7 +9,7 @@ export default class HashNavigation {
const params = {};
let path = [];
if (parts[0]) {
path = parts[0].substr(1).split('/');
path = parts[0].replace('#', '').split('/');
}
if (parts[1]) {
parts[1].split('&').forEach(function(part) {
@@ -60,7 +60,11 @@ export default class HashNavigation {
static setUrlInfoPanel(hash, infopanel) {
const parsed = this.parseUrlHash(hash);
parsed.params.info = infopanel;
if (infopanel) {
parsed.params.info = infopanel;
} else {
delete parsed.params.info;
}
return this.composeUrlHash(parsed.path, parsed.params);
}