【问题标题】:Problems with CKEditor dialog on top of Bootstrap modal windowBootstrap 模态窗口顶部的 CKEditor 对话框的问题
【发布时间】:2014-12-23 10:03:38
【问题描述】:

我已经包含了一个插件here,使用CKEditor 在我的站点上包含代码sn-ps。有了这个,我发现人们对CKEditor对话框和Bootstrap的模态窗口有问题。任何打开的对话框都没有焦点,无法输入文本。

找到了解决方案here。这解决了我与其他对话框有关的问题,但不是使用此预标签插件打开的对话框。有没有人有任何建议让代码 sn-ps 在 CKEditor 和 Bootstrap 中正常工作?

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

【问题讨论】:

    标签: javascript jquery twitter-bootstrap ckeditor code-snippets


    【解决方案1】:

    解决方案是添加条件

    && !$(e.target.parentNode).hasClass('cke_dialog_ui_input_textarea')
    

    现在可以了!希望对遇到同样问题的人有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 2017-02-22
      • 2015-10-26
      • 1970-01-01
      • 1970-01-01
      • 2013-02-27
      相关资源
      最近更新 更多