Skip to content
Snippets Groups Projects
Commit e1d82216 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch '1002-fixed-bar-for-iterator' into 'master'

Enable fixed header in CRUDIterator

See merge request !1456
parents 06c49a63 e033c9c7
No related branches found
No related tags found
1 merge request!1456Enable fixed header in CRUDIterator
Pipeline #181829 failed
...@@ -57,6 +57,10 @@ ...@@ -57,6 +57,10 @@
<slot name="additionalActions" :attrs="attrs" :on="on" /> <slot name="additionalActions" :attrs="attrs" :on="on" />
</template> </template>
</c-r-u-d-bar> </c-r-u-d-bar>
<div
v-if="fixedHeader"
class="c-r-u-d-iterator-fixed-header-placeholder"
/>
</template> </template>
<template #default="slotProps"> <template #default="slotProps">
...@@ -136,6 +140,15 @@ export default { ...@@ -136,6 +140,15 @@ export default {
? this.$attrs.headers.filter((header) => !header.disableEdit) ? this.$attrs.headers.filter((header) => !header.disableEdit)
: []; : [];
}, },
fixedHeaderTop() {
return `${this.$vuetify.application.top}px`;
},
fixedHeaderWidth() {
return `calc(100vw - ${this.$vuetify.application.left}px - ${this.$vuetify.application.right}px)`;
},
fixedHeaderLeft() {
return `${this.$vuetify.application.left}px`;
},
}, },
methods: { methods: {
handleItems(items) { handleItems(items) {
...@@ -168,9 +181,17 @@ export default { ...@@ -168,9 +181,17 @@ export default {
<style lang="scss"> <style lang="scss">
.c-r-u-d-iterator-fixed-header { .c-r-u-d-iterator-fixed-header {
position: sticky; position: fixed;
/* TODO: This should use the v-toolbar height instead. But it is not accessible here. */ width: v-bind(fixedHeaderWidth);
top: 64px; left: v-bind(fixedHeaderLeft);
top: v-bind(fixedHeaderTop);
z-index: 3; z-index: 3;
} }
.c-r-u-d-iterator-fixed-header-placeholder {
height: v-bind(fixedHeaderTop);
position: sticky;
top: v-bind(fixedHeaderTop);
z-index: 2;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment