4

I am using Ckeditor, for one of my project. It has feature of "maximize" in which, it readers in full browser window. The problem is when I click on browser back button, it goes to the previous page, loosing the content of the form.

Can we make it in a way, that when I click on browser back button, it goes back to the form instead of previous page.

-- Thanks for your time.

Kalpesh Patel
  • 2,772
  • 2
  • 25
  • 52

1 Answers1

8

You cannot overwrite the back/forward functionality of any browser since it would violate many security aspects. See: How to disable Back button in IE and firefox?, https://stackoverflow.com/a/12103965/1485219

At most, you can display an alert to let user know about unsaved data etc. Maximized CKEditor instance is nothing more than a block element positioned to cover the entire webpage. It has nothing to do with browser navigation.

Anyway, if you wish to maximize editor with your code:

CKEDITOR.instances.yourInstance.execCommand( 'maximize' );
console.log( CKEDITOR.instances.yourInstance.commands.maximize.state );
Community
  • 1
  • 1
oleq
  • 15,697
  • 1
  • 38
  • 65