Get the topmost modal, or undefined if there are no modals.
The topmost modal, or undefined if there are no modals.
Close a specific modal.
The modal to close. Must be an exact match (i.e. reference equality).
Close all open modals.
Pop the topmost modal off the stack and close it. If there are no modals, this does nothing.
The modal that was popped off the stack, or undefined if there were no modals.
Push a modal onto the stack. This will become the new topmost modal. Existing modals will not be closed.
Set the current modal. Always closes any current modals. In other words, the modal stack is replaced with this modal, or cleared if the argument is undefined.
Controls general modal state. This is NOT tightly integrated with BaseModal because some modals do not use BaseModal, such as the materia pickers. More specifically, this class does not handle any of the actual rendering of a modal. Modals are expected to attack themselves to the DOM in a reasonable way, and to provide a method to force-close them.
This treats modals as a stack. You can do five main operations: