Skip to content
Snippets Groups Projects
Verified Commit 8486a0d5 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Use hash instead of slug for person overview widgets

parent 6f586f6b
No related branches found
No related tags found
1 merge request!1695Fix URL patterns to follow URL scheme
......@@ -53,7 +53,9 @@ export default {
</slot>
<v-toolbar-title>
{{ $root.toolbarTitle }}
<slot name="title">
{{ $root.toolbarTitle }}
</slot>
</v-toolbar-title>
<v-spacer></v-spacer>
......
......@@ -317,24 +317,20 @@ export default {
required: false,
default: null,
},
widgetSlug: {
type: String,
required: false,
default: "default",
},
},
methods: {
maximizeWidget(slug) {
if (this.widgetSlug !== slug) {
if (this.id) {
this.$router.push({
name: "core.personByIdWithSlug",
params: { id: this.id, widgetSlug: slug },
name: "core.personById",
params: { id: this.id },
hash: "#" + slug,
});
} else {
this.$router.push({
name: "core.personWithSlug",
params: { widgetSlug: slug },
name: "core.person",
hash: "#" + slug,
});
}
}
......@@ -342,13 +338,12 @@ export default {
minimizeWidgets() {
if (this.id) {
this.$router.push({
name: "core.personByIdWithSlug",
params: { id: this.id, widgetSlug: "default" },
name: "core.personById",
params: { id: this.id },
});
} else {
this.$router.push({
name: "core.personWithSlug",
params: { widgetSlug: "default" },
name: "core.person",
});
}
},
......@@ -357,6 +352,9 @@ export default {
widgets() {
return collections.corePersonWidgets.items;
},
widgetSlug() {
return this.$hash;
},
},
};
</script>
......
......@@ -11,6 +11,11 @@ const aleksisMixin = {
$_aleksis_safeTrackedEvents: new Array(),
};
},
computed: {
$hash() {
return this.$route?.hash ? this.$route.hash.substring(1) : "";
},
},
methods: {
safeAddEventListener(target, event, handler) {
console.debug("Safely adding handler for %s on %o", event, target);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment