Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markNehus/f82e93c431b464ab3dbe1c253ad5e7f2 to your computer and use it in GitHub Desktop.
Save markNehus/f82e93c431b464ab3dbe1c253ad5e7f2 to your computer and use it in GitHub Desktop.

Revisions

  1. markNehus revised this gist Aug 6, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bootstrap-ckeditor-modal-fix.js
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@

    $.fn.modal.Constructor.prototype.enforceFocus = function() {
    modal_this = this
    $(document).on('focusin.modal', function (e) {
    $(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')) {
  2. @kaddopur kaddopur created this gist Apr 5, 2014.
    17 changes: 17 additions & 0 deletions bootstrap-ckeditor-modal-fix.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // 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('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()
    }
    })
    };