2023-10-02 12:06:35 -04:00
|
|
|
import { App, Widget } from '../../imports.js';
|
2023-10-08 00:43:35 -04:00
|
|
|
const { Revealer, Box, Window } = Widget;
|
2023-10-02 12:06:35 -04:00
|
|
|
|
2023-09-21 20:01:14 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
export default ({
|
2023-10-08 00:43:35 -04:00
|
|
|
name,
|
|
|
|
child,
|
|
|
|
transition = 'slide_down',
|
2023-10-17 13:47:02 -04:00
|
|
|
onOpen = rev => {},
|
|
|
|
...props
|
|
|
|
}) => {
|
|
|
|
let window = Window({
|
|
|
|
name,
|
|
|
|
popup: true,
|
|
|
|
visible: false,
|
|
|
|
layer: 'overlay',
|
|
|
|
...props,
|
2023-09-22 01:34:36 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
child: Box({
|
|
|
|
style: 'min-height:1px; min-width:1px',
|
|
|
|
child: Revealer({
|
|
|
|
transition,
|
|
|
|
transitionDuration: 500,
|
|
|
|
connections: [[App, (rev, currentName, visible) => {
|
|
|
|
if (currentName === name) {
|
|
|
|
rev.reveal_child = visible;
|
|
|
|
onOpen(child);
|
2023-10-08 00:43:35 -04:00
|
|
|
|
2023-10-17 13:47:02 -04:00
|
|
|
if (visible && name !== 'overview')
|
|
|
|
App.openWindow('closer');
|
|
|
|
}
|
|
|
|
}]],
|
|
|
|
child: child,
|
|
|
|
}),
|
2023-10-08 00:43:35 -04:00
|
|
|
}),
|
2023-10-17 13:47:02 -04:00
|
|
|
});
|
|
|
|
window.getChild = () => child;
|
|
|
|
return window;
|
|
|
|
}
|