mirror of
https://github.com/Lissy93/dashy.git
synced 2025-12-15 13:03:28 +01:00
active column count flowing to Section
This commit is contained in:
parent
bd08a227db
commit
fda26bb305
2 changed files with 6 additions and 2 deletions
|
|
@ -14,6 +14,7 @@
|
|||
:id="sectionRef"
|
||||
:ref="sectionRef"
|
||||
>
|
||||
{{ activeColCount }}
|
||||
<!-- If no items, show message -->
|
||||
<div v-if="isEmpty" class="no-items">
|
||||
{{ $t('home.no-items-section') }}
|
||||
|
|
@ -128,6 +129,7 @@ export default {
|
|||
widgets: Array,
|
||||
index: Number,
|
||||
isWide: Boolean,
|
||||
activeColCount: Number,
|
||||
},
|
||||
components: {
|
||||
Collapsable,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
<!-- Main content, section for each group of items -->
|
||||
<div v-if="checkTheresData(sections) || isEditMode" :class="computedClass"
|
||||
ref="sectionsContainer">
|
||||
<span style="position: absolute;">{{readActiveColCount()}}</span>
|
||||
<template v-for="(section, index) in filteredSections">
|
||||
<Section
|
||||
:key="index"
|
||||
|
|
@ -38,6 +37,7 @@
|
|||
@change-modal-visibility="updateModalVisibility"
|
||||
:isWide="!!singleSectionView || layoutOrientation === 'horizontal'"
|
||||
:class="(searchValue && section.filteredItems.length === 0) ? 'no-results' : ''"
|
||||
:activeColCount="activeColCount"
|
||||
/>
|
||||
</template>
|
||||
<!-- Show add new section button, in edit mode -->
|
||||
|
|
@ -85,6 +85,7 @@ export default {
|
|||
layout: '',
|
||||
itemSizeBound: '',
|
||||
addNewSectionOpen: false,
|
||||
activeColCount: 1,
|
||||
}),
|
||||
computed: {
|
||||
singleSectionView() {
|
||||
|
|
@ -179,7 +180,7 @@ export default {
|
|||
if (!sectionsContainer) return;
|
||||
const cs = getComputedStyle(sectionsContainer);
|
||||
const varVal = cs.getPropertyValue('--col-count').trim();
|
||||
console.log(varVal);
|
||||
this.activeColCount = varVal;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -187,6 +188,7 @@ export default {
|
|||
this.initiateMaterialDesignIcons();
|
||||
this.layout = this.layoutOrientation;
|
||||
this.itemSizeBound = this.iconSize;
|
||||
this.readActiveColCount();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue