diff --git a/js/app.js b/js/app.js index dbc92d2f12..6f30edec01 100644 --- a/js/app.js +++ b/js/app.js @@ -128,7 +128,8 @@ function HashTable(obj) { $.fn.modal.Constructor.prototype.enforceFocus = function () { var that = this; $(document).on('focusin.modal', function (e) { - if ($(e.target).hasClass('select2-input') || $(e.target).hasClass('select2-search__field') || $(e.target).hasClass('hexInput') ) { + var $target = $(e.target); + if ($target.hasClass('select2-input') || $target.hasClass('select2-search__field') || $target.hasClass('hexInput') ) { return true; } @@ -136,6 +137,11 @@ $.fn.modal.Constructor.prototype.enforceFocus = function () { if ($parent.hasClass('cke_dialog_ui_input_select') || $parent.hasClass('cke_dialog_ui_input_text')) { return true; } + + // Allow stacking of modals + if($target.closest('.modal.in').length) { + return true; + } if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { that.$element.focus();