mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Improve popups (#5068)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
9f929f0290
commit
bee1986299
@ -23,6 +23,7 @@ export interface CompAndProps {
|
|||||||
options: {
|
options: {
|
||||||
category: string
|
category: string
|
||||||
overlay: boolean
|
overlay: boolean
|
||||||
|
fixed?: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +60,7 @@ export function showPopup (
|
|||||||
options: {
|
options: {
|
||||||
category: string
|
category: string
|
||||||
overlay: boolean
|
overlay: boolean
|
||||||
|
fixed?: boolean
|
||||||
} = { category: 'popup', overlay: true }
|
} = { category: 'popup', overlay: true }
|
||||||
): PopupResult {
|
): PopupResult {
|
||||||
const id = `${popupId++}`
|
const id = `${popupId++}`
|
||||||
@ -94,7 +96,12 @@ export function closePopup (category?: string): void {
|
|||||||
if (category !== undefined) {
|
if (category !== undefined) {
|
||||||
popups = popups.filter((p) => p.options.category !== category)
|
popups = popups.filter((p) => p.options.category !== category)
|
||||||
} else {
|
} else {
|
||||||
popups.pop()
|
for (let i = popups.length - 1; i >= 0; i--) {
|
||||||
|
if (popups[i].options.fixed !== true) {
|
||||||
|
popups.splice(i, 1)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return popups
|
return popups
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user