DrawerWidgetSessionMixin
Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the developer guide for concepts. Built into JBrowse core. View source.
Adds the widget drawer to a session: the open widgets, which one is showing, and the drawer's side, width and minimized state.
Properties
| Member | Description |
|---|---|
drawerPositionDrawerPosition · default storedDrawerPosition() |
|
drawerWidthnumber · default 384 |
|
widgetsMap<string, Widget> · default {} |
|
activeWidgetsMap<string, Widget | undefined> · default {} |
|
minimizedboolean · default false |
Volatiles
| Member | Description |
|---|---|
poppedOutboolean |
true while the visible widget is shown in a modal dialog instead of the drawer. Volatile because a restored session that opened straight into a modal, with no drawer behind it, is disorienting |
modalWidgetsboolean |
set by a host with no room for a drawer column beside its views (a phone), so every widget shows in a modal instead |
Getters
| Member | Description |
|---|---|
visibleWidgetWidget | undefined |
|
drawerVisibleboolean |
whether the drawer column is on screen: there is something to show, it is not minimized to the FAB, and it is not currently a modal instead. A getter rather than each host's own &&, because the hosts drifted -- the app shell tested poppedOut and the embedded view did not, so the day a popout button reaches the embedded drawer header it would render the modal and the drawer at once. |
effectiveDrawerWidthnumber |
the visible widget's preferred width while it has one, else the saved drawerWidth, which a wide mode therefore never overwrites |
modalWidgetVisibleboolean |
whether the visible widget shows in a modal: popped out of the drawer, or on a host with no room for one |
Actions
| Member | Description |
|---|---|
setDrawerPosition(arg: DrawerPosition) => void |
|
updateDrawerWidth(drawerWidth: number, availableWidth?: number) => number |
|
resizeDrawer(distance: number, availableWidth?: number) => number |
|
| addWidget |
|
showWidget(widget: Widget) => void |
|
hideWidget(widget: Widget) => void |
closes the widget, and removes it from the session when its type sets discardOnClose. Minimizing the drawer is not closing. |
minimizeWidgetDrawer() => void |
|
showWidgetDrawer() => void |
|
popoutWidget() => void |
show the visible widget in a modal dialog, freeing the drawer column |
returnWidgetToDrawer() => void |
|
setModalWidgets(flag: boolean) => void |
|
hideAllWidgets() => void |
|
closeModalWidget() => void |
the modal's close button: a popped-out widget goes back to the drawer, and with no drawer to go back to the widget closes |
| openWidget |
adds the widget, replacing one with the same id, and shows it |
| editConfiguration |
opens a configuration editor to configure the given thing, and sets the current task to be configuring it |
Related links
- Developer guide: Drawer widgets