Forked from kaddopur/bootstrap-ckeditor-modal-fix.js
Last active
August 6, 2018 21:17
-
-
Save markNehus/f82e93c431b464ab3dbe1c253ad5e7f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // bootstrap-ckeditor-modal-fix.js | |
| // hack to fix ckeditor/bootstrap compatiability bug when ckeditor appears in a bootstrap modal dialog | |
| // | |
| // Include this AFTER both bootstrap and ckeditor are loaded. | |
| // From: http://stackoverflow.com/questions/14420300/bootstrap-with-ckeditor-equals-problems | |
| // Author: http://stackoverflow.com/users/185839/aaron | |
| $.fn.modal.Constructor.prototype.enforceFocus = function() { | |
| modal_this = this | |
| $(document).on('shown.bs.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() | |
| } | |
| }) | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Addresses issues with CKEditor text areas within modal or popup elements.