Closed Offerel closed 3 years ago
I have found a workaround. I'm using now the following code:
document.addEventListener("keyup", event => {
if(event.key == 'Escape') {
if(document.getElementById('estate').value == 'e') {
mde.togglePreview();
document.querySelector('.editor-toolbar').style.display = 'none';
document.getElementById('estate').value = 's';
}
}
});
I'm using a hidden input field with id = estate, to track, if the editor is edit mode or preview mode. Not ideal, but its ok for me.
I have setup easyMDE to toggle the Editor to Preview mode (from Edit mode) by pressing ESC key with:
Is there a way to hide the toolbar with the same key? Meaning, i will switch to a preview only mode with this. Is that possible?