mirror of
https://github.com/humhub/humhub.git
synced 2025-03-21 07:29:53 +01:00
Fixed multiple bootstrap modal focus error.
This commit is contained in:
parent
33684cba58
commit
d0c82ec115
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user