From bc49a6e2951a0fe91ac927a6fd895b0cdd5b8dbc Mon Sep 17 00:00:00 2001 From: Angel Cubas Date: Tue, 17 Nov 2020 19:03:57 -0500 Subject: [PATCH] Social: Fix bug in CKEditor when adding link or image - refs BT#17928 --- main/social/group_view.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main/social/group_view.php b/main/social/group_view.php index e3f0540ac4..9d1834c071 100644 --- a/main/social/group_view.php +++ b/main/social/group_view.php @@ -76,6 +76,17 @@ function add_image_form() { } } +$.fn.modal.Constructor.prototype.enforceFocus = function() { + modal_this = this + $(document).on("focusin.modal", function (e) { + if (modal_this.$element[0] !== e.target && !modal_this.$element.has(e.target).length + && !$(e.target.parentNode).hasClass("cke_dialog_ui_input_select") + && !$(e.target.parentNode).hasClass("cke_dialog_ui_input_text")) { + modal_this.$element.focus() + } + }) +}; + '; $allowed_views = ['mygroups', 'newest', 'pop'];