2017-03-02 34 views
12

Tôi đã mở ckeditor bên trong phương thức khởi động nhưng định dạng và kích thước thả xuống không hoạt động đúng cách. Khi tôi bấm vào kích thước hoặc định dạng thả xuống nó sẽ mở ra và đóng ngay lập tức, tôi đọc rằng nó là một lỗi trong ckeditor cho bootstrap phương thức. Tôi tìm thấy giải pháp trực tuyến cho nó nhưng điều đó không hoạt động.Sự cố thả xuống Ckeditor trên phương thức Bootstrap (Mở và đóng ngay lập tức khi nhấp)

giải pháp tôi tìm thấy trực tuyến và không làm việc: -

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

JS từ nơi tôi gọi jsp và nơi biên tập ck:

$scope.emailMsgSetting = function(msgId, headerName) { 
    $ocLazyLoad.load({ 
     name: 'emailSettingsModule', 
     files: ['/doc/jsp/portal/viewMessageSettings.js'] 
    }).then(function() { 
     var url = makeURL("/doc/jsp/portal/viewMessageSettings.jsp?"); 
     $scope.dataURL = url; 
    }, function(e) { 
     console.log(e); 
    }); 
} 

JSP nơi tôi đã thực hiện biên tập ck

<div class="col-sm-11 nopadright" ng-if="showckeditor"> 
    <textarea ng-model="$parent.msgTypeBody" ck-editor insert-tag="strTagName" height="ckEditorheight" extra-plugins= "strTagName"></textarea> 
    </div> 

Cảm ơn ..

+0

Bạn đang sử dụng phiên bản bootstrap nào? – vickisys

+0

@vickisys Bootstrap v3.2.0 – pise

+0

Bất kỳ trang trực tiếp nào từ trang web của bạn để kiểm tra? –

Trả lời

0
$.fn.modal.Constructor.prototype.enforceFocus = function() { 
    var $modalElement = this.$element; 
    $(document).on('focusin.modal', function (e) { 
     var $parent = $(e.target.parentNode); 
     if ($modalElement[0] !== e.target && !$modalElement.has(e.target).length 
      // add whatever conditions you need here: 
      && 
      !$parent.hasClass('cke_dialog_ui_input_select') && !$parent.hasClass('cke_dialog_ui_input_text')) { 
      $modalElement.focus() 
     } 
    }) 
}; 
Các vấn đề liên quan