Skip to content

Commit

Permalink
Un-expand system & addon settings when re-entering settings page
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Nov 22, 2023
1 parent d8e29f1 commit b2d8983
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:key="a.uid"
:link="'addons/' + a.uid"
:title="a.label" />
<f7-list-button v-if="!expanded && addonsInstalled.length > addonsSettings.length" color="blue" @click="expanded = true">
<f7-list-button v-if="!expanded && addonsInstalled.length > addonsSettings.length" color="blue" @click="$emit('expanded', true)">
{{ $t('dialogs.showAll') }}
</f7-list-button>
</f7-list>
Expand All @@ -18,16 +18,16 @@

<script>
export default {
props: ['addonsInstalled', 'addonsServices'],
props: ['addonsInstalled', 'addonsServices', 'expanded'],
emits: ['expanded'],
data () {
return {
ready: false,
expanded: false
ready: false
}
},
computed: {
addonsSettings () {
if (this.expanded) return this.addonsInstalled
if (this.expanded !== false) return this.addonsInstalled
return this.addonsInstalled.filter((a) =>
a.type === 'persistence' ||
this.addonsServices.findIndex((as) => as.configDescriptionURI.split(':')[1] === a.id) > -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@
</f7-list>
</div>
<div v-if="$store.getters.apiEndpoint('addons') && addonsLoaded && $f7.width < 1450">
<addon-section class="add-on-section" :addonsInstalled="addonsInstalled" :addonsServices="addonsServices" />
<addon-section class="add-on-section" :addonsInstalled="addonsInstalled" :addonsServices="addonsServices" :expanded="expandedTypes.addonSettings" @expanded="expandedTypes.addonSettings = true" />
</div>
</f7-col>
<f7-col width="33" class="add-on-col">
<div v-if="$store.getters.apiEndpoint('addons') && addonsLoaded && $f7.width >= 1450">
<addon-section :addonsInstalled="addonsInstalled" :addonsServices="addonsServices" />
<addon-section :addonsInstalled="addonsInstalled" :addonsServices="addonsServices" :expanded="expandedTypes.addonSettings" @expanded="expandedTypes.addonSettings = true" />
</div>
</f7-col>
</f7-row>
Expand Down Expand Up @@ -191,7 +191,8 @@ export default {
],
expandedTypes: {
systemSettings: this.$f7.width >= 1450
systemSettings: this.$f7.width >= 1450,
addonSettings: false
}
}
},
Expand Down Expand Up @@ -250,6 +251,8 @@ export default {
this.loadMenu()
},
onPageAfterIn () {
this.$set(this.expandedTypes, 'systemSettings', this.$f7.width >= 1450)
this.$set(this.expandedTypes, 'addonSettings', false)
// this.loadMenu()
this.loadCounters()
}
Expand Down

0 comments on commit b2d8983

Please sign in to comment.