feat: show title and tab buttons at the top while scrolling
Signed-off-by: Luka Trovic <luka@nextcloud.com>
This commit is contained in:
@@ -171,6 +171,8 @@ export default {
|
|||||||
|
|
||||||
.modal-wrapper--normal .modal-container{
|
.modal-wrapper--normal .modal-container{
|
||||||
width: 900px !important;
|
width: 900px !important;
|
||||||
|
height: 800px !important;
|
||||||
|
overflow-y: hidden !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -21,35 +21,37 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="currentCard" class="container">
|
<div v-if="currentCard" ref="modalContainer" class="container">
|
||||||
<div class="top">
|
<div :class="{defaultTop: scrollPosition < 100, fixedTop: scrollPosition > 100}">
|
||||||
<h1 class="top-title">
|
<div class="top">
|
||||||
{{ currentCard.title }}
|
<h1 class="top-title">
|
||||||
</h1>
|
{{ currentCard.title }}
|
||||||
<p class="top-modified">
|
</h1>
|
||||||
{{ t('deck', 'Modified') }}: {{ currentCard.lastModified | fromNow }}. {{ t('deck', 'Created') }} {{ currentCard.createdAt | fromNow }}
|
<p class="top-modified">
|
||||||
</p>
|
{{ t('deck', 'Modified') }}: {{ currentCard.lastModified | fromNow }}. {{ t('deck', 'Created') }} {{ currentCard.createdAt | fromNow }}
|
||||||
</div>
|
</p>
|
||||||
<div class="tabs">
|
|
||||||
<div class="tab members" :class="{active: activeTabs.includes('members')}" @click="changeActiveTab('members')">
|
|
||||||
<i class="icon-user icon" />
|
|
||||||
{{ t('deck', 'Members') }}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tab tags" :class="{active: activeTabs.includes('tags')}" @click="changeActiveTab('tags')">
|
<div class="tabs">
|
||||||
<i class="icon icon-tag" />
|
<div class="tab members" :class="{active: activeTabs.includes('members')}" @click="changeActiveTab('members')">
|
||||||
{{ t('deck', 'Tags') }}
|
<i class="icon-user icon" />
|
||||||
</div>
|
{{ t('deck', 'Members') }}
|
||||||
<div class="tab due-date" :class="{active: activeTabs.includes('duedate')}" @click="changeActiveTab('duedate')">
|
</div>
|
||||||
<i class="icon icon-calendar-dark" />
|
<div class="tab tags" :class="{active: activeTabs.includes('tags')}" @click="changeActiveTab('tags')">
|
||||||
{{ t('deck', 'Due date') }}
|
<i class="icon icon-tag" />
|
||||||
</div>
|
{{ t('deck', 'Tags') }}
|
||||||
<div class="tab project" :class="{active: activeTabs.includes('project')}" @click="changeActiveTab('project')">
|
</div>
|
||||||
<i class="icon icon-deck" />
|
<div class="tab due-date" :class="{active: activeTabs.includes('duedate')}" @click="changeActiveTab('duedate')">
|
||||||
{{ t('deck', 'Project') }}
|
<i class="icon icon-calendar-dark" />
|
||||||
</div>
|
{{ t('deck', 'Due date') }}
|
||||||
<div class="tab attachments" :class="{active: activeTabs.includes('attachment')}" @click="changeActiveTab('attachment')">
|
</div>
|
||||||
<i class="icon-attach icon icon-attach-dark" />
|
<div class="tab project" :class="{active: activeTabs.includes('project')}" @click="changeActiveTab('project')">
|
||||||
{{ t('deck', 'Attachments') }}
|
<i class="icon icon-deck" />
|
||||||
|
{{ t('deck', 'Project') }}
|
||||||
|
</div>
|
||||||
|
<div class="tab attachments" :class="{active: activeTabs.includes('attachment')}" @click="changeActiveTab('attachment')">
|
||||||
|
<i class="icon-attach icon icon-attach-dark" />
|
||||||
|
{{ t('deck', 'Attachments') }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -174,6 +176,7 @@ export default {
|
|||||||
currentTab: null,
|
currentTab: null,
|
||||||
activeTabs: [],
|
activeTabs: [],
|
||||||
showDetails: false,
|
showDetails: false,
|
||||||
|
scrollPosition: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -214,8 +217,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.modalContainer.addEventListener('scroll', this.onScroll)
|
||||||
|
})
|
||||||
this.loadComments()
|
this.loadComments()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
cancelReply() {
|
cancelReply() {
|
||||||
this.$store.dispatch('setReplyTo', null)
|
this.$store.dispatch('setReplyTo', null)
|
||||||
@@ -266,19 +273,15 @@ export default {
|
|||||||
this.titleEditable = false
|
this.titleEditable = false
|
||||||
this.$store.dispatch('updateCardTitle', { ...this.currentCard, title: this.titleEditing })
|
this.$store.dispatch('updateCardTitle', { ...this.currentCard, title: this.titleEditing })
|
||||||
},
|
},
|
||||||
|
|
||||||
closeSidebar() {
|
closeSidebar() {
|
||||||
this.$router.push({ name: 'board' })
|
this.$router.push({ name: 'board' })
|
||||||
},
|
},
|
||||||
|
|
||||||
showModal() {
|
showModal() {
|
||||||
this.$store.dispatch('setConfig', { cardDetailsInModal: true })
|
this.$store.dispatch('setConfig', { cardDetailsInModal: true })
|
||||||
},
|
},
|
||||||
|
|
||||||
closeModal() {
|
closeModal() {
|
||||||
this.$store.dispatch('setConfig', { cardDetailsInModal: false })
|
this.$store.dispatch('setConfig', { cardDetailsInModal: false })
|
||||||
},
|
},
|
||||||
|
|
||||||
changeActiveTab(tab) {
|
changeActiveTab(tab) {
|
||||||
this.currentTab = tab
|
this.currentTab = tab
|
||||||
this.activeTabs = this.activeTabs.filter((item) => !['project', 'attachment'].includes(item))
|
this.activeTabs = this.activeTabs.filter((item) => !['project', 'attachment'].includes(item))
|
||||||
@@ -288,13 +291,15 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
removeActiveTab(tab) {
|
removeActiveTab(tab) {
|
||||||
const index = this.activeTabs.indexOf(tab)
|
const index = this.activeTabs.indexOf(tab)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.activeTabs = this.activeTabs.splice(index, 1)
|
this.activeTabs = this.activeTabs.splice(index, 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onScroll() {
|
||||||
|
this.scrollPosition = this.$refs.modalContainer.scrollTop
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -358,6 +363,13 @@ export default {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
margin-top: 100px;
|
margin-top: 100px;
|
||||||
|
padding-left: 20px !important;
|
||||||
|
padding-right: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content{
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
@@ -375,10 +387,12 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
padding: 20px;
|
overflow-y: scroll;
|
||||||
|
height: 800px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
|
padding: 20px 20px 0px 20px;
|
||||||
&-title {
|
&-title {
|
||||||
color: black;
|
color: black;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
@@ -391,6 +405,8 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tabs {
|
.tabs {
|
||||||
|
padding-left: 20px;
|
||||||
|
padding-right: 20px;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -432,4 +448,13 @@ export default {
|
|||||||
color: #409eff;
|
color: #409eff;
|
||||||
background-color: #ecf5ff;
|
background-color: #ecf5ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fixedTop {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
background-color: #ffffff;
|
||||||
|
z-index: 1000;
|
||||||
|
margin-top: 0px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user