Created
April 12, 2019 09:40
-
-
Save manhlinhng/73dcd7e64f7513348e3f300e3059d931 to your computer and use it in GitHub Desktop.
Vấn đề khi CKEditor nằm trong modal bootstrap, chúng ta bật CKFinder và không thể tương tác trên popup của CKFinder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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 | |
// add whatever conditions you need here: | |
&& | |
!$(e.target.parentNode).hasClass('cke_dialog_ui_input_select') && !$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) { | |
modal_this.$element.focus() | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment