question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to "close" the editor?

See original GitHub issue

I’m using this nice tool to make a classic <div> editable for a moment, then I want to make it switch back to its normal form. Is there a function for this? I tried with disable() but it just makes the editor… uneditable.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yourcelfcommented, Jan 31, 2015

I’ve run into this problem when showing the editor in a modal and needing to destroy/rebuild on show/hide. I’m using an iframe/textarea, and these are the steps I’ve had to take:

  • remove the iframe
  • replace the toolbar to unbind events (using something like jQuery.clone and jQuery.replaceWith works well to rebuild the toolbar without stale bound events).
  • replace the textarea to unbind events (same clone trick, though you have to manually copy the textarea’s value also)

A convenient destroy() or unbind() would be really nice to save that hassle.

0reactions
filipe-nunescommented, Mar 18, 2016

I think this issue is still not completely resolved… even with editor.destroy() and editor = null, my toolbar keeps the old events…

EDIT: Got it to work with @yourcelf 's clone and replaceWith suggestion. (Still destroy not doing its job 100% for me…)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to exit (quit) Linux vi editor with or without saving ...
To exit with saving changes made: · Press < Escape> . (You must be in insert or append mode if not, just start...
Read more >
Quit the vi editor without saving your changes - IU KB
Quit the vi editor without saving your changes · If you are currently in insert or append mode, press Esc . · Press...
Read more >
An introduction to the vi editor | Enable Sysadmin - Red Hat
To save a file, you must first be in Command mode. Press Esc to enter Command mode, and then type :wq to write...
Read more >
Closing an editor
Select File > Close from the menu bar. Note the prompt to save the file before the editor is closed. Click OK to...
Read more >
How to Exit (Quit) Linux Vim/Vi editor - phoenixNAP
Exit Vim in Terminal · 1. Press the Esc key. · 2. You should see the ––INSERT–– label vanish from the lower-left. ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found