Created
September 9, 2013 17:05
-
-
Save michaelstephens/6498551 to your computer and use it in GitHub Desktop.
How to detect a change to ck_editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onbeforeunload = (e) -> | |
e = e or window.event | |
isDirty = false | |
for i of CKEDITOR.instances | |
isDirty = true if CKEDITOR.instances[i].checkDirty() | |
if isDirty is true | |
e.returnValue = "Your document has UNSAVED CHANGES If you continue those changes will be LOST." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment