1
1
<script setup lang="ts">
2
- import { computed , defineProps } from ' vue'
2
+ import { computed , defineProps , ref } from ' vue'
3
3
import { isDark , toggleDark } from ' ../logic/dark'
4
4
import { hasNext , hasPrev , prev , next , total , isPresenter , currentPage , downloadPDF } from ' ../logic/nav'
5
- import { toggleOverview , showEditor , showInfoDialog , fullscreen , breakpoints } from ' ../state'
5
+ import { toggleOverview , showEditor , showInfoDialog , fullscreen , breakpoints , activeElement } from ' ../state'
6
6
import { configs } from ' ../env'
7
7
import RecordingControls from ' ./RecordingControls.vue'
8
8
import Settings from ' ./Settings.vue'
@@ -19,10 +19,16 @@ const { isFullscreen, toggle: toggleFullscreen } = fullscreen
19
19
20
20
const presenterLink = computed (() => ` ${location .origin }/presenter/${currentPage .value } ` )
21
21
const nonPresenterLink = computed (() => ` ${location .origin }/${currentPage .value } ` )
22
+
23
+ const root = ref <HTMLDivElement >()
24
+ const onMouseLeave = () => {
25
+ if (root .value && activeElement .value && root .value .contains (activeElement .value ))
26
+ activeElement .value .blur ()
27
+ }
22
28
</script >
23
29
24
30
<template >
25
- <nav class =" flex flex-wrap-reverse text-xl p-2 gap-1" >
31
+ <nav ref = " root " class =" flex flex-wrap-reverse text-xl p-2 gap-1" @mouseleave = " onMouseLeave " >
26
32
<button class =" icon-btn" @click =" toggleFullscreen" >
27
33
<carbon:minimize v-if =" isFullscreen" />
28
34
<carbon:maximize v-else />
0 commit comments