mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-07 08:12:19 +02:00
Fix image viewer with back button, join message spacing
This commit is contained in:
parent
7b24050de9
commit
d42232ab77
|
@ -98,16 +98,6 @@ export default defineComponent({
|
||||||
link.value = null;
|
link.value = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
onBeforeRouteLeave((to, from, next) => {
|
|
||||||
next();
|
|
||||||
|
|
||||||
// cancel the navigation if the user is trying to close the image viewer
|
|
||||||
if (link.value) {
|
|
||||||
closeViewer();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const setPrevNextImages = () => {
|
const setPrevNextImages = () => {
|
||||||
if (!channel.value || !link.value) {
|
if (!channel.value || !link.value) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -142,6 +142,7 @@ import {
|
||||||
ref,
|
ref,
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
|
import {onBeforeRouteUpdate} from "vue-router";
|
||||||
import eventbus from "../js/eventbus";
|
import eventbus from "../js/eventbus";
|
||||||
import friendlysize from "../js/helpers/friendlysize";
|
import friendlysize from "../js/helpers/friendlysize";
|
||||||
import {useStore} from "../js/store";
|
import {useStore} from "../js/store";
|
||||||
|
@ -168,6 +169,16 @@ export default defineComponent({
|
||||||
const isContentShown = ref(false);
|
const isContentShown = ref(false);
|
||||||
const imageViewer = inject(imageViewerKey);
|
const imageViewer = inject(imageViewerKey);
|
||||||
|
|
||||||
|
onBeforeRouteUpdate((to, from, next) => {
|
||||||
|
// cancel the navigation if the user is trying to close the image viewer
|
||||||
|
if (imageViewer?.value?.link) {
|
||||||
|
imageViewer.value.closeViewer();
|
||||||
|
return next(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
const content = ref<HTMLDivElement | null>(null);
|
const content = ref<HTMLDivElement | null>(null);
|
||||||
const container = ref<HTMLDivElement | null>(null);
|
const container = ref<HTMLDivElement | null>(null);
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<span class="content">
|
<span class="content">
|
||||||
<Username :user="message.from" />
|
<Username :user="message.from" />
|
||||||
<i class="hostmask"> (<ParsedMessage :network="network" :text="message.hostmask" />)</i>
|
<i class="hostmask"> (<ParsedMessage :network="network" :text="message.hostmask" />) </i>
|
||||||
<template v-if="message.account">
|
<template v-if="message.account">
|
||||||
<i class="account"> [{{ message.account }}]</i>
|
<i class="account">[{{ message.account }}]</i>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="message.gecos">
|
<template v-if="message.gecos">
|
||||||
<i class="realname"> {{ message.gecos }}</i>
|
<i class="realname">{{ message.gecos }}</i>
|
||||||
</template>
|
</template>
|
||||||
has joined the channel
|
has joined the channel
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue