You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vizality/renderer/src/api/Modals.js

38 lines
874 B

/**
* The modals API allows you to easily open (and close) modals of various types.
* @module Modals
* @memberof API
* @namespace API.Modals
* @version 1.0.0
*/
/*
* @todo Add showAlert, showPrompt, showConfirm, showModal (type property: alert, prompt, confirm)
* Add closeAlert, closePrompt, closeConfirm, closeModal, closeAllAlerts, closeAllPrompts,
* closeAllConfirms, closeAllModals
*/
import { assertString } from '@vizality/util/string';
import { API } from '@vizality/entities';
/**
* All currently active modals.
* Accessed with `getAllModals` below.
*/
let modals = [];
/**
* @extends API
* @extends Events
*/
export default class Modals extends API {
/**
* Shuts down the API, removing all listeners and stored objects.
*/
stop () {
this.unregisterAllModals();
this.removeAllListeners();
delete vizality.api.modals;
}
}