Fixed reset editor on pageunload.

Now post before page unload