From b2bb9cfb92726e6462cd549445bb7662da71bd46 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 25 Mar 2015 14:28:03 +0000 Subject: [PATCH] Do not show alert if another one is already shown --- src/mibew/js/source/default/utils.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/mibew/js/source/default/utils.js b/src/mibew/js/source/default/utils.js index 35738f98..15329a25 100644 --- a/src/mibew/js/source/default/utils.js +++ b/src/mibew/js/source/default/utils.js @@ -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}); }