bootstrap的模态弹窗 和CKEditor的模态弹窗冲突问题解决

bootstrap的模态弹窗 和CKEditor的模态弹窗,使用时。会造成编辑器的弹出框中的文本框不能编辑。

解决办法:

在页面中添加一段代码即可:

$.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()
                }
            })
        };

 

2014-06-13

posted on 2014-06-13 17:04  大地哥  阅读(824)  评论(0)    收藏  举报