Thứ Năm, 9 tháng 8, 2018

fix lỗi không edit đc thuộc tính của ảnh trong ckeditor trên modal

Lỗi này chỉ xuất hiện khi gọi ckeditor trên modal. Cách fix là sẽ thêm 1 hàm extension cho js để force focus vào modal edit property ảnh:

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


Không có nhận xét nào:

Đăng nhận xét