feat(ags popup window): add onClose method
This commit is contained in:
parent
5bde3b8608
commit
4eb9d259cf
2 changed files with 10 additions and 2 deletions
|
@ -139,6 +139,7 @@ export const PlayerIcon = (player, { symbolic = true, ...props } = {}) => {
|
|||
}
|
||||
else {
|
||||
children.push(Separator(2));
|
||||
// TODO: make this clickable to switch
|
||||
children.push(Box({ className: 'position-indicator' }));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,11 @@ export default ({
|
|||
// Revealer props
|
||||
transition = 'slide_down',
|
||||
transitionDuration = 500,
|
||||
// Optional: execute a function whenever the window pops up
|
||||
|
||||
// Optional: execute a function whenever
|
||||
// the window pops up or goes away
|
||||
onOpen = () => {},
|
||||
onClose = () => {},
|
||||
|
||||
// Window props
|
||||
name,
|
||||
|
@ -45,7 +48,11 @@ export default ({
|
|||
connections: [[App, (rev, currentName, visible) => {
|
||||
if (currentName === name) {
|
||||
rev.revealChild = visible;
|
||||
onOpen(child);
|
||||
|
||||
if (visible)
|
||||
onOpen(child);
|
||||
else
|
||||
onClose(child);
|
||||
}
|
||||
}]],
|
||||
child: child,
|
||||
|
|
Loading…
Reference in a new issue