CKEditor Focus Detection

trying to fix a problem when on an iOS device the keyboard breaks fixed elements.

When I click on the CKEditor text area, my goal is to set the style of a fixed element to a fixed one.

Not sure how to determine if CKEditor is focusing.

None of what I tried worked, here is the main thing:

http://jsfiddle.net/B4yGJ/180/

CKEDITOR.replace('editor1'); $('#editor1').focus(function() { alert('Focused'); }); 
+5
source share
2 answers

CKEditor has its own focal event, I hope this will be useful for you. See Docs here: http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-focus

You can use it like this:

 CKEDITOR.on('instanceReady', function(evt) { var editor = evt.editor; console.log('The editor named ' + editor.name + ' is now ready'); editor.on('focus', function(e) { console.log('The editor named ' + e.editor.name + ' is now focused'); }); }); CKEDITOR.replace('editor1'); 

JSFiddle at http://jsfiddle.net/B4yGJ/181/

+7
source

enter image description here Actually jquery hides your editor '# editor1' and creates a new jquery editor. But still you start the hidden text editor (#editor) . thats whay ur not getting warning window

-1
source

Source: https://habr.com/ru/post/1202560/


All Articles