Skip to content

Commit

Permalink
viewer: minor refactor
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <[email protected]>
  • Loading branch information
pulsejet committed Mar 11, 2024
1 parent 0a323f3 commit c463ecf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/components/viewer/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
@pointermove.passive="setUiVisible"
@pointerdown.passive="setUiVisible"
>
<div class="top-bar" v-if="photoswipe" :class="{ showControls }">
<div class="top-bar" v-if="photoswipe" :class="{ visible: showControls }">
<NcActions :inline="numInlineActions" container=".memories_viewer .pswp">
<NcActionButton
v-for="action of actions"
Expand All @@ -37,7 +37,7 @@
</NcActions>
</div>
<div class="bottom-bar" v-if="photoswipe" :class="{ showControls, showBottomBar }">
<div class="bottom-bar" v-if="photoswipe" :class="{ visible: showBottomBar }">
<div class="exif title" v-if="currentPhoto?.imageInfo?.exif?.Title">
{{ currentPhoto.imageInfo.exif.Title }}
</div>
Expand Down Expand Up @@ -374,7 +374,7 @@ export default defineComponent({
/** Show bottom bar info such as date taken */
showBottomBar(): boolean {
return !this.isVideo && this.fullyOpened && Boolean(this.currentPhoto?.imageInfo);
return this.showControls && !this.isVideo && this.fullyOpened && Boolean(this.currentPhoto?.imageInfo);
},
/** Allow closing the viewer */
Expand Down Expand Up @@ -1004,6 +1004,10 @@ export default defineComponent({
if (e.key === 'Delete') {
this.deleteCurrent();
}
if (e.key === 'Tab') {
this.photoswipe?.element?.classList.add('pswp--ui-visible');
}
},
/** Delete this photo and refresh */
Expand Down Expand Up @@ -1248,7 +1252,7 @@ export default defineComponent({
this.stopSlideshow();
}
this.photoswipe?.updateSize();
this.refs.outer?.focus();
this.photoswipe?.template?.focus();
},
/**
Expand Down Expand Up @@ -1298,7 +1302,7 @@ export default defineComponent({
transition: opacity 0.2s ease-in-out;
opacity: 0;
pointer-events: none;
&.showControls {
&.visible {
opacity: 1;
pointer-events: auto;
}
Expand All @@ -1316,7 +1320,7 @@ export default defineComponent({
transition: opacity 0.2s ease-in-out;
opacity: 0;
&.showControls.showBottomBar {
&.visible {
opacity: 1;
}
Expand Down

0 comments on commit c463ecf

Please sign in to comment.