/**
 * CKEDITOR RTE
 */
IGDATAPOOLFE.ckeditors = {};
IGDATAPOOLFE.plugins.add('ckeditor', {
    form: null,
    initFields: function(form) {
	this.init(form);
    },
    init: function(form) {
	this.form = form;
	document.querySelectorAll('.dp-ckeditor textarea').forEach(function(el) {
	    if(!el.closest('.dp-inlinerecord-container-new')) {
		var id = el.id;
		var config = null;
		if(el.closest('.dp-ckeditor').getAttribute('data-config')) {
		    config = el.closest('.dp-ckeditor').getAttribute('data-config');
		}
		ClassicEditor
		    .create( document.getElementById(id), config)
		    .then( editor => {
		    IGDATAPOOLFE.ckeditors[ id ] = editor;
		} );
	    }
	});
    }
});