tags:

views:

18

answers:

1

In CKEditor, is there an event that can be bound to which fires when the user switches between the WYSIWYG view and the source view?

If not, I need to enable/disable some other controls on the page when the view changes; what's my best strategy?

A: 

I'm still unable to find any documentation, but after poking around the internals of a CKEditor instance, I was able to find the event I'm looking for:

instance.on('mode', function() {
     // Code to execute when the user switches editing modes
}

Easy enough. The event fires once when the editor is initialized and again any time the source command is activated (either through instance.execCommand(...) or the user clicking a Source toolbar button).

josh3736