steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
661 stars 1.71k forks source link

Destroy method #53

Open andrelcm opened 8 years ago

andrelcm commented 8 years ago

Is there a way to destroy the editor and turn back to the original div, but with the edited content in it?

codewithtyler commented 8 years ago

I'm not sure I follow what you're asking. What would be the purpose of destroying it if you want to keep the content?

andrelcm commented 8 years ago

Look at this: http://summernote.org/#/example#click2edit When you destroy the editor, you go back to the original div, without the toolbar or any bounds (to save memory), but you save the content that may have changed.

codewithtyler commented 8 years ago

Ah I see. Essentially the toolbar itself is hidden and only appears when you hit a button. The destroy function would be tied to the save button as it hides the toolbar again. In the past people have developed their own version of this to work with the editor as it can be implemented in multiple ways.

@steveathon what do you think? I do think it would be a good idea if we could implement the destroy method ourselves. It would make implementing an admin page easier for anyone who uses our editor.