I created several custom plugins, but only one of them listens for key events on the keyboard. Below in the code you can see the setting for setting events. (and this is kind of basic)
Now I have the following problem: if I set my data using editor.setData in the ListReady instance. then .on functions are not installed.
I tried replacing the contentDom with an instanceReady event, but that also does not fix it.
if I set the data manually using: editor.document.getBody (). setHtml (html), no problem. and all events are attached without any problems.
CKEDITOR.plugins.add( 'myPlugin', { lang: '', // %REMOVE_LINE_CORE% init: function( editor ) { //Bind events if the Dom is ready! editor.on( 'contentDom', function() { //keydown editor.document.on('keydown', function(e) {
Does anyone know why this is happening? Does the setData function install only html or does it reload the editor or something else?
I looked at this Ckeditor Source, but I think this is not code that has anything to do with the setData function.
I do not ask permission. I like to understand why this is happening.
spons
source share