2018-03-29 17:20:15 +02:00
|
|
|
<template>
|
2019-09-29 07:28:36 +02:00
|
|
|
<div id="contents" ref="contents" :style="customWidth" @mouseup="dragEnd" @mousemove="resize">
|
2019-05-16 16:02:05 +02:00
|
|
|
<div
|
|
|
|
:class="openSideBar ? 'timeline-wrapper-with-side-bar' : 'timeline-wrapper'"
|
|
|
|
v-loading="loading"
|
|
|
|
:element-loading-text="$t('message.loading')"
|
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
|
>
|
|
|
|
<router-view></router-view>
|
|
|
|
</div>
|
2019-09-28 15:48:44 +02:00
|
|
|
<template v-if="openSideBar">
|
2019-09-29 07:28:36 +02:00
|
|
|
<transition name="slide-detail">
|
|
|
|
<div>
|
|
|
|
<div id="resizer">
|
|
|
|
<div class="border"></div>
|
2019-09-29 08:02:53 +02:00
|
|
|
<div class="knob" @mousedown="dragStart">
|
|
|
|
<icon name="ellipsis-v" class="icon"></icon>
|
|
|
|
</div>
|
2019-09-29 07:28:36 +02:00
|
|
|
</div>
|
|
|
|
<side-bar id="side_bar" :overlaid="modalOpened"></side-bar>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2019-09-28 15:48:44 +02:00
|
|
|
</template>
|
2018-03-29 17:20:15 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2018-08-30 02:03:38 +02:00
|
|
|
import { mapState, mapGetters } from 'vuex'
|
2018-03-29 17:20:15 +02:00
|
|
|
import SideBar from './Contents/SideBar'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'contents',
|
2019-09-28 15:48:44 +02:00
|
|
|
data() {
|
|
|
|
return {
|
2019-09-29 07:28:36 +02:00
|
|
|
sidebarWidth: 360,
|
|
|
|
dragging: false
|
2019-09-28 15:48:44 +02:00
|
|
|
}
|
|
|
|
},
|
2018-03-29 17:20:15 +02:00
|
|
|
components: {
|
|
|
|
SideBar
|
|
|
|
},
|
|
|
|
computed: {
|
2019-05-16 16:02:05 +02:00
|
|
|
...mapState('TimelineSpace/Contents', {
|
|
|
|
loading: state => state.loading
|
2018-08-30 02:03:38 +02:00
|
|
|
}),
|
2019-05-16 16:02:05 +02:00
|
|
|
...mapState('TimelineSpace/Contents/SideBar', {
|
|
|
|
openSideBar: state => state.openSideBar
|
|
|
|
}),
|
2019-09-28 15:48:44 +02:00
|
|
|
...mapGetters('TimelineSpace/Modals', ['modalOpened']),
|
2020-10-14 18:01:55 +02:00
|
|
|
customWidth: function () {
|
2019-09-28 15:48:44 +02:00
|
|
|
return {
|
|
|
|
'--current-sidebar-width': `${this.sidebarWidth}px`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
resize(event) {
|
2019-09-29 07:28:36 +02:00
|
|
|
if (this.dragging && event.clientX) {
|
2019-09-28 15:48:44 +02:00
|
|
|
this.sidebarWidth = window.innerWidth - event.clientX
|
|
|
|
}
|
2019-09-29 07:28:36 +02:00
|
|
|
},
|
|
|
|
dragStart() {
|
|
|
|
this.dragging = true
|
|
|
|
this.$refs.contents.style.setProperty('user-select', 'none')
|
|
|
|
},
|
|
|
|
dragEnd() {
|
|
|
|
this.dragging = false
|
|
|
|
this.$refs.contents.style.setProperty('user-select', 'text')
|
2019-09-28 15:48:44 +02:00
|
|
|
}
|
2018-03-29 17:20:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
#contents {
|
2019-09-28 15:48:44 +02:00
|
|
|
--current-sidebar-width: 360px;
|
|
|
|
|
2020-10-14 18:01:55 +02:00
|
|
|
padding-top: 49px;
|
2018-03-29 17:20:15 +02:00
|
|
|
height: 100%;
|
|
|
|
box-sizing: border-box;
|
2019-09-29 07:28:36 +02:00
|
|
|
user-select: text;
|
2018-03-29 17:20:15 +02:00
|
|
|
|
|
|
|
.timeline-wrapper {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.timeline-wrapper-with-side-bar {
|
|
|
|
height: 100%;
|
2019-09-28 15:48:44 +02:00
|
|
|
width: calc(100% - var(--current-sidebar-width));
|
2018-03-29 17:20:15 +02:00
|
|
|
}
|
2019-09-28 15:48:44 +02:00
|
|
|
|
|
|
|
#resizer {
|
2019-09-29 07:28:36 +02:00
|
|
|
.border {
|
|
|
|
width: 1px;
|
|
|
|
background-color: var(--theme-border-color);
|
|
|
|
height: calc(100% - 48px);
|
|
|
|
position: fixed;
|
|
|
|
top: 48px;
|
|
|
|
right: var(--current-sidebar-width);
|
|
|
|
}
|
|
|
|
|
|
|
|
.knob {
|
|
|
|
width: 8px;
|
|
|
|
background-color: var(--theme-border-color);
|
|
|
|
height: 72px;
|
|
|
|
position: fixed;
|
|
|
|
top: 50%;
|
|
|
|
right: calc(var(--current-sidebar-width) - 8px);
|
|
|
|
z-index: 1000;
|
|
|
|
border-radius: 0 8px 8px 0;
|
|
|
|
cursor: col-resize;
|
2019-09-29 08:02:53 +02:00
|
|
|
text-align: center;
|
|
|
|
vertical-align: middle;
|
|
|
|
line-height: 72px;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
display: inline-block;
|
|
|
|
color: var(--theme-secondary-color);
|
|
|
|
}
|
2019-09-29 07:28:36 +02:00
|
|
|
}
|
2019-09-28 15:48:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#side_bar {
|
|
|
|
position: fixed;
|
|
|
|
top: 48px;
|
|
|
|
right: 0;
|
|
|
|
width: var(--current-sidebar-width);
|
|
|
|
height: calc(100% - 48px);
|
|
|
|
border-left: solid 1px var(--theme-border-color);
|
|
|
|
}
|
2018-03-29 17:20:15 +02:00
|
|
|
}
|
2019-09-29 07:28:36 +02:00
|
|
|
|
|
|
|
.slide-detail-enter-active,
|
|
|
|
.slide-detail-leave-active {
|
|
|
|
transition: all 0.5s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.slide-detail-enter,
|
|
|
|
.slide-detail-leave-to {
|
|
|
|
margin-right: -360px;
|
|
|
|
opacity: 0;
|
|
|
|
}
|
2018-03-29 17:20:15 +02:00
|
|
|
</style>
|