From 9524d5cd09760afb359cbc960935d034c1205e25 Mon Sep 17 00:00:00 2001 From: Alexander Platov Date: Mon, 30 Aug 2021 14:43:35 +0300 Subject: [PATCH] Fix Popup Position on default (#89) Signed-off-by: Alexander Platov --- packages/ui/src/components/Dialog copy.svelte | 113 +++++++++++++++++ packages/ui/src/components/Dialog.svelte | 120 ++++++++---------- packages/ui/src/components/Popup.svelte | 10 +- .../src/components/TableView.svelte | 4 +- 4 files changed, 171 insertions(+), 76 deletions(-) create mode 100644 packages/ui/src/components/Dialog copy.svelte diff --git a/packages/ui/src/components/Dialog copy.svelte b/packages/ui/src/components/Dialog copy.svelte new file mode 100644 index 0000000000..e2bd87c7b9 --- /dev/null +++ b/packages/ui/src/components/Dialog copy.svelte @@ -0,0 +1,113 @@ + + + + +
+
{ okAction(); dispatch('close') }}> +
+
+
{ dispatch('close') }}>
+
+
+ +
+ +
+
+ + \ No newline at end of file diff --git a/packages/ui/src/components/Dialog.svelte b/packages/ui/src/components/Dialog.svelte index f2ad72721f..8d710a0fec 100644 --- a/packages/ui/src/components/Dialog.svelte +++ b/packages/ui/src/components/Dialog.svelte @@ -31,84 +31,66 @@ const dispatch = createEventDispatcher() -
-
{ okAction(); dispatch('close') }}> - -
- -
- -
-
+
{ okAction(); dispatch('close') }}> +
+ +
+ +
\ No newline at end of file diff --git a/packages/ui/src/components/Popup.svelte b/packages/ui/src/components/Popup.svelte index 4c99455bc1..d97316c398 100644 --- a/packages/ui/src/components/Popup.svelte +++ b/packages/ui/src/components/Popup.svelte @@ -48,17 +48,17 @@ } if (rect.left > document.body.clientWidth - rect.right) { // style += 'left' - // modalHTML.style.right = document.body.clientWidth - rect.right + 'px' - modalHTML.style.right = '0px' + modalHTML.style.right = document.body.clientWidth - rect.right + 'px' } else { // style += 'right' modalHTML.style.left = rect.left + 'px' } // modalHTML.classList.add(style) } else { - modalHTML.style.top = '50%' - modalHTML.style.left = '50%' - modalHTML.style.transform = 'translate(-50%, -50%)' + modalHTML.style.top = '16px' + modalHTML.style.bottom = '16px' + modalHTML.style.right = '16px' + // modalHTML.style.transform = 'translateY(-50%)' } } } diff --git a/plugins/view-resources/src/components/TableView.svelte b/plugins/view-resources/src/components/TableView.svelte index cabae49e99..bbe8db5f6b 100644 --- a/plugins/view-resources/src/components/TableView.svelte +++ b/plugins/view-resources/src/components/TableView.svelte @@ -19,7 +19,7 @@ import type { Ref, Class, Doc, Space, FindOptions } from '@anticrm/core' import { buildModel } from '../utils' import { getClient } from '@anticrm/presentation' - import { Label, showModal, Loading, ScrollBox } from '@anticrm/ui' + import { Label, showPopup, Loading, ScrollBox } from '@anticrm/ui' import type { AnyComponent } from '@anticrm/ui' import { createQuery } from '@anticrm/presentation' @@ -50,7 +50,7 @@ const client = getClient() function onClick(object: Doc) { - showModal(open, { object, space }) + showPopup(open, { object, space }) }