Unverified Commit e7a8adca authored by Alireza Heidari's avatar Alireza Heidari Committed by mvdbeek
Browse files

Improve current list offset calculation

parent 0b421e68
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@
                                :items="itemsLoaded"
                                :query-key="queryKey"
                                @scroll="onScroll">
                                <template v-slot:item="{ item, getOffset }">
                                <template v-slot:item="{ item, currentOffset }">
                                    <ContentItem
                                        v-if="!invisible[item.hid]"
                                        :id="item.hid"
@@ -114,7 +114,7 @@
                                        @toggleHighlights="toggleHighlights"
                                        @update:expand-dataset="setExpanded(item, $event)"
                                        @update:selected="setSelected(item, $event)"
                                        @view-collection="$emit('view-collection', item, getOffset)"
                                        @view-collection="$emit('view-collection', item, currentOffset)"
                                        @delete="onDelete(item)"
                                        @undelete="onUndelete(item)"
                                        @unhide="onUnhide(item)" />
+2 −2
Original line number Diff line number Diff line
@@ -56,8 +56,8 @@ export default {
        };
    },
    methods: {
        onViewCollection(collection, getListOffset) {
            this.listOffset = getListOffset();
        onViewCollection(collection, currentOffset) {
            this.listOffset = currentOffset;
            this.breadcrumbs = [...this.breadcrumbs, collection];
        },
    },
+2 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
            :data-component="{}"
            @scroll="onScroll">
            <template v-slot:item="{ item }">
                <slot name="item" :item="item" :get-offset="getOffset" />
                <slot name="item" :item="item" :current-offset="getOffset()" />
            </template>
            <template v-slot:footer>
                <LoadingSpan v-if="loading" class="m-2" message="Loading" />
@@ -77,7 +77,7 @@ export default {
            this.$emit("scroll", rangeStart);
        },
        getOffset() {
            return this.$refs.listing.getOffset();
            return this.$refs.listing?.getOffset() || 0;
        },
    },
};