mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-25 04:25:13 +03:00
Fix popup position (#210)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
7733f44e11
commit
e6715a1970
@ -15,7 +15,6 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Component from './Component.svelte'
|
|
||||||
import type { AnySvelteComponent, AnyComponent, PopupAlignment } from '../types'
|
import type { AnySvelteComponent, AnyComponent, PopupAlignment } from '../types'
|
||||||
import { closePopup } from '..'
|
import { closePopup } from '..'
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ $: {
|
|||||||
}
|
}
|
||||||
if (rect.left + rectPopup.width + 16 > document.body.clientWidth) {
|
if (rect.left + rectPopup.width + 16 > document.body.clientWidth) {
|
||||||
modalHTML.style.left = ''
|
modalHTML.style.left = ''
|
||||||
modalHTML.style.right = '1rem'
|
modalHTML.style.right = document.body.clientWidth - rect.right + 'px'
|
||||||
} else {
|
} else {
|
||||||
modalHTML.style.left = rect.left + 'px'
|
modalHTML.style.left = rect.left + 'px'
|
||||||
modalHTML.style.right = ''
|
modalHTML.style.right = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user