2019-01-14 09:23:13 -08:00
|
|
|
<template>
|
2019-03-11 09:51:37 -07:00
|
|
|
<div class="modal-view media-modal-view" v-if="showing" @click.prevent="hide">
|
2019-01-14 09:23:13 -08:00
|
|
|
<img class="modal-image" v-if="type === 'image'" :src="currentMedia.url"></img>
|
2019-01-26 07:45:03 -08:00
|
|
|
<VideoAttachment
|
2019-01-14 09:23:13 -08:00
|
|
|
class="modal-image"
|
|
|
|
v-if="type === 'video'"
|
2019-01-26 07:45:03 -08:00
|
|
|
:attachment="currentMedia"
|
|
|
|
:controls="true"
|
|
|
|
@click.stop.native="">
|
|
|
|
</VideoAttachment>
|
2019-02-19 08:33:40 -08:00
|
|
|
<button
|
|
|
|
:title="$t('media_modal.previous')"
|
|
|
|
class="modal-view-button-arrow modal-view-button-arrow--prev"
|
|
|
|
v-if="canNavigate"
|
|
|
|
@click.stop.prevent="goPrev"
|
|
|
|
>
|
|
|
|
<i class="icon-left-open arrow-icon" />
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
:title="$t('media_modal.next')"
|
|
|
|
class="modal-view-button-arrow modal-view-button-arrow--next"
|
|
|
|
v-if="canNavigate"
|
|
|
|
@click.stop.prevent="goNext"
|
|
|
|
>
|
|
|
|
<i class="icon-right-open arrow-icon" />
|
|
|
|
</button>
|
2019-01-14 09:23:13 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./media_modal.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2019-03-11 09:51:37 -07:00
|
|
|
.media-modal-view {
|
2019-05-05 10:48:25 -07:00
|
|
|
z-index: 1001;
|
|
|
|
|
2019-02-19 08:33:40 -08:00
|
|
|
&:hover {
|
|
|
|
.modal-view-button-arrow {
|
|
|
|
opacity: 0.75;
|
2019-02-10 10:26:08 -08:00
|
|
|
|
2019-02-19 08:33:40 -08:00
|
|
|
&:focus,
|
|
|
|
&:hover {
|
|
|
|
outline: none;
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
2019-02-10 10:23:01 -08:00
|
|
|
&:hover {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
2019-02-19 08:33:40 -08:00
|
|
|
}
|
|
|
|
}
|
2019-02-10 10:23:01 -08:00
|
|
|
|
2019-02-19 08:33:40 -08:00
|
|
|
.modal-image {
|
|
|
|
max-width: 90%;
|
|
|
|
max-height: 90%;
|
|
|
|
box-shadow: 0px 5px 15px 0 rgba(0, 0, 0, 0.5);
|
|
|
|
}
|
2019-02-10 10:23:01 -08:00
|
|
|
|
2019-02-19 08:33:40 -08:00
|
|
|
.modal-view-button-arrow {
|
|
|
|
position: absolute;
|
|
|
|
display: block;
|
|
|
|
top: 50%;
|
|
|
|
margin-top: -50px;
|
|
|
|
width: 70px;
|
|
|
|
height: 100px;
|
|
|
|
border: 0;
|
|
|
|
padding: 0;
|
|
|
|
opacity: 0;
|
|
|
|
box-shadow: none;
|
|
|
|
background: none;
|
|
|
|
appearance: none;
|
|
|
|
overflow: visible;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: opacity 333ms cubic-bezier(.4,0,.22,1);
|
|
|
|
|
|
|
|
.arrow-icon {
|
|
|
|
position: absolute;
|
|
|
|
top: 35px;
|
|
|
|
height: 30px;
|
|
|
|
width: 32px;
|
|
|
|
font-size: 14px;
|
|
|
|
line-height: 30px;
|
|
|
|
color: #FFF;
|
|
|
|
text-align: center;
|
|
|
|
background-color: rgba(0,0,0,.3);
|
|
|
|
}
|
|
|
|
|
|
|
|
&--prev {
|
|
|
|
left: 0;
|
|
|
|
.arrow-icon {
|
|
|
|
left: 6px;
|
2019-02-10 10:23:01 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-19 08:33:40 -08:00
|
|
|
&--next {
|
|
|
|
right: 0;
|
|
|
|
.arrow-icon {
|
|
|
|
right: 6px;
|
2019-02-10 10:23:01 -08:00
|
|
|
}
|
|
|
|
}
|
2019-01-14 09:23:13 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|