From 1cd2b2bdb41b1a74d004d33946760f65a8b1be71 Mon Sep 17 00:00:00 2001 From: weryques Date: Wed, 2 May 2018 15:12:44 -0300 Subject: [PATCH] Adds collapse all --- src/admin/pages/lists/items-page.vue | 35 ++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/admin/pages/lists/items-page.vue b/src/admin/pages/lists/items-page.vue index bf6f1498e..c4b08d30c 100644 --- a/src/admin/pages/lists/items-page.vue +++ b/src/admin/pages/lists/items-page.vue @@ -13,10 +13,24 @@ -

{{ $i18n.get('filters') }}

+ + +

{{ $i18n.get('filters') }}

+ + {{ collapseAll ? $i18n.get('label_collapse_all') : $i18n.get('label_expand_all') }} + + +
+ + :filters="filters" + :collapsed="collapseAll"/> +
@@ -112,7 +126,8 @@ isLoadingFilters: false, isLoadingFields: false, hasFiltered: false, - isFiltersMenuCompressed: false + isFiltersMenuCompressed: false, + collapseAll: true, } }, props: { @@ -139,7 +154,14 @@ ]), ...mapGetters('filter', [ 'getFilters' - ]) + ]), + toggleCollapseAll() { + this.collapseAll = !this.collapseAll; + + for (let i = 0; i < this.fieldCollapses.length; i++) + this.fieldCollapses[i] = this.collapseAll; + + }, }, computed: { items() { @@ -260,6 +282,11 @@ @import '../../scss/_variables.scss'; + .collapse-all { + font-size: 12px; + .icon { vertical-align: bottom; } + } + .page-container, .page-container-small { padding: 0px;