Skip to content

Commit 4e04683

Browse files
committed
Corrections
Signed-off-by: Alexander Platov <[email protected]>
1 parent f058999 commit 4e04683

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

packages/ui/src/components/Popup.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@
2727
instances.forEach((p) => p.fitPopupInstance())
2828
}
2929
30-
const checkFS = (popup: any): boolean => {
30+
const shouldDisplayPopup = (popup: any): boolean => {
3131
return (
32-
(fullScreen && document.fullscreen && popup.element !== 'full-centered') ||
33-
(!fullScreen && document.fullscreen && popup.element === 'full-centered') ||
34-
(!fullScreen && !document.fullscreen)
32+
(fullScreen && document.fullscreenElement != null && popup.element !== 'full-centered') ||
33+
(!fullScreen && document.fullscreenElement != null && popup.element === 'full-centered') ||
34+
(!fullScreen && document.fullscreenElement == null)
3535
)
3636
}
3737
38-
$: instances.length = $popups.filter((p) => p.dock !== true && checkFS(p)).length
38+
$: instances.length = $popups.filter((p) => p.dock !== true && shouldDisplayPopup(p)).length
3939
</script>
4040

4141
{#if $popups.length > 0}
4242
<slot name="popup-header" />
4343
{/if}
44-
{#each $popups.filter((p) => p.dock !== true && checkFS(p)) as popup, i (popup.id)}
44+
{#each $popups.filter((p) => p.dock !== true && shouldDisplayPopup(p)) as popup, i (popup.id)}
4545
<PopupInstance
4646
bind:this={instances[i]}
4747
is={popup.is}

packages/ui/src/components/TooltipInstance.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
visibility: 'hidden',
6767
classList: ''
6868
}
69-
const checkFS = (): boolean => (fullScreen && !document.fullscreen) || (!fullScreen && document.fullscreen)
69+
const shouldHideTooltip = (): boolean =>
70+
(fullScreen && document.fullscreenElement == null) || (!fullScreen && document.fullscreenElement != null)
7071
7172
const clearStyles = (): void => {
7273
shown = false
@@ -251,7 +252,7 @@
251252
}
252253
253254
const hideTooltip = (): void => {
254-
if (checkFS()) return
255+
if (shouldHideTooltip()) return
255256
if (tooltipHTML) options.visibility = 'hidden'
256257
shown = false
257258
closeTooltip()
@@ -260,7 +261,7 @@
260261
$: shownTooltip = $tooltip.element && tooltipHTML
261262
262263
const whileShow = (ev: MouseEvent): void => {
263-
if (!$tooltip.element || checkFS()) return
264+
if (!$tooltip.element || shouldHideTooltip()) return
264265
const rectP = tooltipHTML.getBoundingClientRect()
265266
rect = $tooltip.element.getBoundingClientRect()
266267
const dT: number = dir === 'bottom' && $tooltip.kind !== 'submenu' ? 12 : 0
@@ -275,15 +276,15 @@
275276
}
276277
277278
$: if (kind === 'submenu') {
278-
if (!checkFS()) options = fitSubmenu()
279+
if (!shouldHideTooltip()) options = fitSubmenu()
279280
} else {
280-
if (!checkFS()) options = fitTooltip(tooltipHTML, clWidth)
281+
if (!shouldHideTooltip()) options = fitTooltip(tooltipHTML, clWidth)
281282
}
282283
afterUpdate(() => {
283284
if (kind === 'submenu') {
284-
if (!checkFS()) options = fitSubmenu()
285+
if (!shouldHideTooltip()) options = fitSubmenu()
285286
} else {
286-
if (!checkFS()) options = fitTooltip(tooltipHTML, clWidth)
287+
if (!shouldHideTooltip()) options = fitTooltip(tooltipHTML, clWidth)
287288
}
288289
})
289290
onDestroy(() => {

plugins/love-resources/src/components/RoomLanguageSelector.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
2222
import { languagesDisplayData } from '../types'
2323
import LanguageIcon from './LanguageIcon.svelte'
24-
import { updateSessionLanguage, isFullScreen } from '../utils'
24+
import { updateSessionLanguage } from '../utils'
2525
2626
export let room: Room
2727
export let kind: 'dropdown' | 'icon' = 'dropdown'

0 commit comments

Comments
 (0)