Hello!
I'm new to CKeditor. I would like know in an external javascript function when the current element changes, in other words I want to know every time the result of editor.getSelection() would change.
For example I want to fire a function when the user changes from a <p> element to the next or when he clicks the bottom bar to switch from a <li>-element to the entire <ul> element. How would you recommend I go about doing this?
Also, after an editor is loaded the getSelection() returns first paragraph, but the bottom bar doesn't show anything. Is there a way to force the bottom bar to display the selected element when the editor is loaded even before a user focuses it?
Thank you in advance!
Edited for clarity
I'm new to CKeditor. I would like know in an external javascript function when the current element changes, in other words I want to know every time the result of editor.getSelection() would change.
For example I want to fire a function when the user changes from a <p> element to the next or when he clicks the bottom bar to switch from a <li>-element to the entire <ul> element. How would you recommend I go about doing this?
Also, after an editor is loaded the getSelection() returns first paragraph, but the bottom bar doesn't show anything. Is there a way to force the bottom bar to display the selected element when the editor is loaded even before a user focuses it?
Thank you in advance!
Edited for clarity