Do not show alert if another one is already shown

This commit is contained in:
Dmitriy Simushev 2015-03-25 14:28:03 +00:00
parent a3f68852ce
commit b2bb9cfb92

View File

@ -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});
}