Hi guys,
Can you show me how to catch "full screen" event? I have a problem when use SME with Drawer (Material Design Lite). See my attach file please.
Regard,
Huka.

@hukacode
You can explicitly set your toolbar items and wrap the SimpleMDE.toggleFullScreen function call with your own logic.
var simplemde = new SimpleMDE({
toolbar: [{
name: "fullscreen",
action: handleToggleFullscreen,
className: "fa fa-arrows-alt no-disable no-mobile",
title: "Toggle Fullscreen",
},
...
],
...
});
const handleToggleFullscreen = () => {
//perform whatever logic you want
simplemde.toggleFullScreen()
}
Hi @CodyJamesCasey ,
It's worked like a magic. Thank you so much!

The custom code won't fire if the user exits full screen by pressing the Esc key though. Is there no other alternate way?
Ended up just doing a monkey-patch on CodeMirror's setOption:
const oldEditorSetOption = editor.codemirror.setOption;
editor.codemirror.setOption = function(option, value) {
oldEditorSetOption.apply(this, arguments);
if (option === 'fullScreen') {
// your code...
}
};
@CodyJamesCasey
This won't work if user press keyboard shortcuts F11 to toggle fullscreen
@CodyJamesCasey used this for a custom image upload modal, thanks a bunch!
Most helpful comment
@hukacode
You can explicitly set your toolbar items and wrap the SimpleMDE.toggleFullScreen function call with your own logic.