fix: no items displayed on file listing
parent
73ccbe912f
commit
18889ad725
|
@ -254,6 +254,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Vue from "vue";
|
||||||
import { mapState, mapGetters, mapMutations } from "vuex";
|
import { mapState, mapGetters, mapMutations } from "vuex";
|
||||||
import { users, files as api } from "@/api";
|
import { users, files as api } from "@/api";
|
||||||
import { enableExec } from "@/utils/constants";
|
import { enableExec } from "@/utils/constants";
|
||||||
|
@ -279,6 +280,7 @@ export default {
|
||||||
showLimit: 50,
|
showLimit: 50,
|
||||||
dragCounter: 0,
|
dragCounter: 0,
|
||||||
width: window.innerWidth,
|
width: window.innerWidth,
|
||||||
|
itemWeight: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -362,8 +364,14 @@ export default {
|
||||||
// Reset the show value
|
// Reset the show value
|
||||||
this.showLimit = 50;
|
this.showLimit = 50;
|
||||||
|
|
||||||
|
// Ensures that the listing is displayed
|
||||||
|
Vue.nextTick(() => {
|
||||||
|
// How much every listing item affects the window height
|
||||||
|
this.setItemWeight();
|
||||||
|
|
||||||
// Fill and fit the window with listing items
|
// Fill and fit the window with listing items
|
||||||
this.fillWindow(true);
|
this.fillWindow(true);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
|
@ -813,6 +821,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setItemWeight() {
|
setItemWeight() {
|
||||||
|
// Listing element is not displayed
|
||||||
|
if (this.$refs.listing == null) return;
|
||||||
|
|
||||||
let itemQuantity = this.req.numDirs + this.req.numFiles;
|
let itemQuantity = this.req.numDirs + this.req.numFiles;
|
||||||
if (itemQuantity > this.showLimit) itemQuantity = this.showLimit;
|
if (itemQuantity > this.showLimit) itemQuantity = this.showLimit;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue