mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 08:14:42 +03:00
Do not show alert if another one is already shown
This commit is contained in:
parent
a3f68852ce
commit
b2bb9cfb92
@ -164,12 +164,24 @@
|
||||
vex.dialog.buttons.NO.text = Mibew.Localization.trans('Cancel');
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks if vex dialog is already opened.
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
var isVexOpened = function () {
|
||||
return (vex.getAllVexes().length > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Alerts a message.
|
||||
* @param {String} message A message that should be displayed.
|
||||
*/
|
||||
Mibew.Utils.alert = function(message) {
|
||||
setVexDefaults();
|
||||
if (isVexOpened()) {
|
||||
// Do not open alert if one already opened.
|
||||
return;
|
||||
}
|
||||
vex.dialog.alert({message: message});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user