mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
e380a4d2b1
* Payment modal done * Refactor settings and added command support * Made sync operations more efficient * Sync button slightly more efficient * Remove Elm * Fixed Codemirror * Nunjucks 3.0 * Revert sourcemap change and some renaming * Some fixes for Config creation, and added name to resources * Set to new Insomnia URL * Some fixes
26 lines
522 B
JavaScript
26 lines
522 B
JavaScript
const modals = {};
|
|
|
|
export function registerModal (instance) {
|
|
if (instance === null) {
|
|
// Modal was unmounted
|
|
return
|
|
}
|
|
modals[instance.constructor.name] = instance;
|
|
}
|
|
|
|
export function showModal (modalCls, ...args) {
|
|
return _getModal(modalCls).show(...args);
|
|
}
|
|
|
|
export function toggleModal (modalCls, ...args) {
|
|
return _getModal(modalCls).toggle(...args);
|
|
}
|
|
|
|
export function hideModal (modalCls) {
|
|
return _getModal(modalCls).hide();
|
|
}
|
|
|
|
function _getModal (modalCls) {
|
|
return modals[modalCls.name];
|
|
}
|