I have opened ckeditor inside bootstrap modal but format and size drop down are not working properly. When I click on size or format drop down it opens and close immediately, I read that it is a bug in ckeditor for bootstrap modal. I found solution online for it but that is not working.
solution I found online and not working :-
$.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 from where I call jsp and where ck editor:
$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 where I have implemented ck editor
<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>
Thanks..