Skip to content

Commit

Permalink
fix: no items displayed on file listing
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiresviana committed Apr 14, 2021
1 parent 73ccbe9 commit 18889ad
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions frontend/src/views/files/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
</template>

<script>
import Vue from "vue";
import { mapState, mapGetters, mapMutations } from "vuex";
import { users, files as api } from "@/api";
import { enableExec } from "@/utils/constants";
Expand All @@ -279,6 +280,7 @@ export default {
showLimit: 50,
dragCounter: 0,
width: window.innerWidth,
itemWeight: 0,
};
},
computed: {
Expand Down Expand Up @@ -362,8 +364,14 @@ export default {
// Reset the show value
this.showLimit = 50;
// Fill and fit the window with listing items
this.fillWindow(true);
// 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
this.fillWindow(true);
});
},
},
mounted: function () {
Expand Down Expand Up @@ -813,6 +821,9 @@ export default {
}
},
setItemWeight() {
// Listing element is not displayed
if (this.$refs.listing == null) return;
let itemQuantity = this.req.numDirs + this.req.numFiles;
if (itemQuantity > this.showLimit) itemQuantity = this.showLimit;
Expand Down

0 comments on commit 18889ad

Please sign in to comment.