Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ckeditor maximize screen

Tags:

ckeditor

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.

like image 425
Kalpesh Patel Avatar asked Feb 17 '23 19:02

Kalpesh Patel


1 Answers

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 );
like image 113
oleq Avatar answered Feb 26 '23 19:02

oleq