Skip to content

Commit 8749e6f

Browse files
committed
Feature(modeling-commons): Add back to top to model lists
1 parent 647680f commit 8749e6f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

apps/modeling-commons-frontend/app/components/model/list/ModelsListing.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<p v-if="totalCount && totalCount > 0" class="mx-auto text-center text-xs text-dimmed">
2121
Showing {{ rows.length }} of {{ totalCount }} models
2222
</p>
23+
24+
<BackToTop :show="showBackToTop" @click="scrollToTop" />
2325
</div>
2426
</template>
2527

@@ -39,6 +41,8 @@ const filters = computed(() => props.filters);
3941
4042
const orientation = ref<"horizontal" | "vertical">("horizontal");
4143
44+
const { show: showBackToTop, scrollToTop } = useBackToTop();
45+
4246
const { rows, totalCount, pending, error, hasMore, refresh, nextPage } = useForumModels({
4347
filters,
4448
});

apps/modeling-commons-frontend/app/pages/models/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@
156156
Showing {{ rows.length }} of {{ totalCount }} models
157157
</p>
158158
</div>
159+
160+
<BackToTop :show="showBackToTop" @click="scrollToTop" />
159161
</UContainer>
160162
</template>
161163

@@ -203,6 +205,8 @@ const highlightFlags = ref({
203205
),
204206
});
205207
208+
const { show: showBackToTop, scrollToTop } = useBackToTop();
209+
206210
const author = reactive(useUserFilter(filters, setFilter));
207211
const tags = reactive(useTagsFilter(filters, setFilter));
208212
const version = reactive(useNetlogoVersionsFilter(filters, setFilter));

0 commit comments

Comments
 (0)