Skip to content

Commit

Permalink
Auto-expand SDK settings detail section from link (#1707)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReubenFrankel authored Mar 15, 2024
1 parent 53e1fbb commit 7a8cfba
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit 7a8cfba

Please sign in to comment.