FroalaEditor destroyed event

Not triggered in the current version, 3.0.6.

by Panman8201

HTML

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/froala_editor.pkgd.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/js/froala_editor.pkgd.min.js"></script>
<div id="editor">
  <p>Foobar</p>
</div>
<button id="destroy">
  Destroy
</button>

JavaScript

var options = {
	events: {
  	'destroy': function() {
    	window.alert('Editor destroyed!');
    }
  }
};

var editor = new FroalaEditor('div#editor', options);

document.querySelector('button#destroy').addEventListener('click', function() {
	window.alert('Destroying editor!');
	editor.destroy();
});