Browse Source

Add `onReady` method to editor

pull/3905/head
Artur Arseniev 5 years ago
parent
commit
7cc226bdb1
  1. 13
      src/editor/index.js

13
src/editor/index.js

@ -728,6 +728,19 @@ export default (config = {}) => {
return editorView.render().el;
},
/**
* Trigger a callback once the editor is loaded and rendered.
* The callback will be executed immediately if the method is called on the already rendered editor.
* @param {Function} clb Event to trigger
* @example
* editor.onReady(() => {
* // perform actions
* });
*/
onReady(clb) {
em.get('ready') ? clb(this) : em.on('load', clb);
},
/**
* Print safe HTML by using ES6 tagged template strings.
* @param {Array<String>} literals

Loading…
Cancel
Save