Sticky header

This commit is contained in:
Matej Glasnák committed 2022-12-20 00:10:41 +01:00
1 parent 1a1b6f99a8
commit 4d84bec298
4 files changed
+90 -5

No files matched your search

@@ -74,6 +74,11 @@ export default {
border-bottom: 1px solid rgba(33, 33, 33, 0.08)
gap: 25px
flex-wrap: wrap
position: sticky
top: 0
z-index: 9999
background: white
.subheader-icon-button
border: 1px solid #ABABAB
@@ -4,8 +4,6 @@
:hide-view-selector="true"
:hide-title-bar="true"
:disable-views="['years', 'year', 'month', 'day']"
:time-from="calConfig.startHour * 60"
:time-to="calConfig.endHour * 60"
:selected-date="calConfig.date"
:onEventClick="taskClicked"
:editable-events="vueCalConfig.editing"
@@ -118,6 +116,10 @@ export default {
}
},
mounted() {
this._scrollToDefaultTime()
},
methods: {
weekChanged() {
const scrollContainer = document.getElementsByClassName('vuecal__scrollable-body')[0]
@@ -187,6 +189,17 @@ export default {
this.focusedEventId = event.task_id
console.log(`Focused: ${event.task_id}`)
},
_scrollToDefaultTime() {
const calendarContainer = document.querySelector('.main-content')
const defaultTimeToScrollTo = document.querySelectorAll('.vuecal__time-cell')[7]
const toolbarHeight = document.querySelector('.v-toolbar').getBoundingClientRect().height
const subheaderHeight = document.querySelector('.subheader').getBoundingClientRect().height
calendarContainer.scrollTo({
top: defaultTimeToScrollTo.getBoundingClientRect().top - toolbarHeight - subheaderHeight
})
},
}
}
</script>