Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-expand SDK settings detail section from link #1707

Merged
merged 3 commits into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/components/PluginSettingsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>
<ul class="list-disc list-inside pl-4">
<li v-for="(setting, index) in definedSettings()" v-bind:key="index">
<a :href="'#' + setting.name.replace(/\./g, '-') + '-setting'"
<a :href="getSettingHref(setting)"
><code>{{ setting.name }}</code></a
>
</li>
Expand All @@ -20,7 +20,7 @@
<summary class="text-xl pb-4 pt-4 font-bold font-hg">Expand To Show SDK Settings</summary>
<ul class="list-disc list-inside pl-4">
<li v-for="(setting, index) in sdkSettings()" v-bind:key="index">
<a :href="'#' + setting.name.replace(/\./g, '-') + '-setting'"
<a :href="getSettingHref(setting)"
><code>{{ setting.name }}</code></a
>
</li>
Expand Down Expand Up @@ -85,7 +85,9 @@
</span>

<div v-if="sdkSettings().length > 0">
<details>
<details
:open="sdkSettings().some((setting) => getSettingHref(setting) === this.$route.hash)"
>
<summary class="text-2xl pb-4 pt-4 font-bold font-hg">
Expand To Show SDK Settings
</summary>
Expand Down Expand Up @@ -160,6 +162,9 @@ export default {
sdkSettings() {
return this.settings.filter((setting) => this.hardcodedValues.includes(setting.name));
},
getSettingHref(setting) {
return `#${setting.name.replace(/\./g, "-")}-setting`;
},
},
};
</script>
Expand Down