[Bootstrap][Ckeditor] Bootstrap中的Model與Ckeditor同時使用時的問題解決方法
當使用Ckeditor在Bootstrap的Model模組時會發生無法點選input控制項的情形
可以在html頁面添加下面的javascript
可以在html頁面添加下面的javascript
// 把這段加在jQuery跟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_textarea')
&& !$(e.target.parentNode).hasClass('cke_dialog_ui_input_text')) {
modal_this.$element.focus()
}
})
};
原文連結
留言
張貼留言