Skip to content

Commit 7d145b3

Browse files
committed
Added tooltip and fixes for popups
Signed-off-by: Alexander Platov <[email protected]>
1 parent 388d7a0 commit 7d145b3

File tree

8 files changed

+173
-203
lines changed

8 files changed

+173
-203
lines changed

packages/ui/src/components/ButtonMenu.svelte

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
export let focusIndex = -1
4444
export let id: string | undefined = undefined
4545
export let dataId: string | undefined = undefined
46-
export let fullScreenPopup: boolean = false
4746
4847
let opened: boolean = false
4948
@@ -58,20 +57,13 @@
5857
}
5958
opened = true
6059
closeTooltip()
61-
showPopup(
62-
ModernPopup,
63-
{ items, selected: noSelection ? undefined : selected, params },
64-
element,
65-
(result) => {
66-
if (result) {
67-
selected = result
68-
dispatch('selected', result)
69-
}
70-
opened = false
71-
},
72-
() => {},
73-
{ category: 'popup', overlay: true, fullScreen: fullScreenPopup }
74-
)
60+
showPopup(ModernPopup, { items, selected: noSelection ? undefined : selected, params }, element, (result) => {
61+
if (result) {
62+
selected = result
63+
dispatch('selected', result)
64+
}
65+
opened = false
66+
})
7567
}
7668
}
7769

packages/ui/src/components/DropdownLabelsIntl.svelte

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
export let width: string | undefined = undefined
3939
export let labelDirection: TooltipAlignment | undefined = undefined
4040
export let shouldUpdateUndefined: boolean = true
41-
export let fullScreenPopup: boolean = false
4241
export let minW0 = true
4342
export let focusIndex: number = -1
4443
export let dataId: string | undefined = undefined
@@ -57,20 +56,13 @@
5756
function openPopup () {
5857
if (!opened) {
5958
opened = true
60-
showPopup(
61-
DropdownLabelsPopupIntl,
62-
{ items, selected, params },
63-
container,
64-
(result) => {
65-
if (result) {
66-
selected = result
67-
dispatch('selected', result)
68-
}
69-
opened = false
70-
},
71-
() => {},
72-
{ category: 'popup', overlay: true, fullScreen: fullScreenPopup }
73-
)
59+
showPopup(DropdownLabelsPopupIntl, { items, selected, params }, container, (result) => {
60+
if (result) {
61+
selected = result
62+
dispatch('selected', result)
63+
}
64+
opened = false
65+
})
7466
}
7567
}
7668

packages/ui/src/components/Popup.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
}
2929
3030
const checkFS = (popup: any): boolean => {
31-
return (fullScreen && popup.options.fullScreen === true) || (!fullScreen && popup.options.fullScreen !== true)
31+
return (
32+
(fullScreen && document.fullscreen && popup.element !== 'full-centered') ||
33+
(!fullScreen && document.fullscreen && popup.element === 'full-centered') ||
34+
(!fullScreen && !document.fullscreen)
35+
)
3236
}
3337
3438
$: instances.length = $popups.filter((p) => p.dock !== true && checkFS(p)).length

0 commit comments

Comments
 (0)