ui: make closable popups singleton to avoid blocking the ui when there are many (ie errors)

This commit is contained in:
jean-emmanuel 2018-02-25 09:30:45 +01:00
parent 3701efc544
commit 02885cebf6

View file

@ -1,9 +1,22 @@
var popupSingleton = null
module.exports = {
Popup: class Popup {
constructor(options) {
if (options.closable) {
if (popupSingleton) {
popupSingleton.close()
popupSingleton = null
}
popupSingleton = this
}
this.closable = options.closable
this.escKey = options.closable || options.escKey
this.enterKey = options.enterKey